From fdde71b442baec96a0c2769f18fce4de49e34426 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 14 Nov 2010 21:45:55 +0100 Subject: [PATCH] Fix one-click moving on up-click (First) up-clicks were not always ignored: in Edit-Game mode with one-click moving enabled this could lead to a capture being made on the down-click, and the recapture on the correspoding up-click. This has now been corrected, and only the down-click of a first click can lead to selecting a piece or a one-click move. --- backend.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/backend.c b/backend.c index c48f16e..bd641fe 100644 --- a/backend.c +++ b/backend.c @@ -6399,8 +6399,14 @@ void LeftClick(ClickType clickType, int xPix, int yPix) if (fromX == -1) { gatingPiece = EmptySquare; + if (clickType != Press) { + if(dragging) { // [HGM] from-square must have been reset due to game end since last press + DragPieceEnd(xPix, yPix); dragging = 0; + DrawPosition(FALSE, NULL); + } + return; + } if(!appData.oneClick || !OnlyMove(&x, &y, FALSE)) { - if (clickType == Press) { /* First square */ if (OKToStartUserMove(x, y)) { fromX = x; @@ -6412,12 +6418,8 @@ void LeftClick(ClickType clickType, int xPix, int yPix) SetHighlights(x, y, -1, -1); } } - } else if(dragging) { // [HGM] from-square must have been reset due to game end since last press - DragPieceEnd(xPix, yPix); dragging = 0; - DrawPosition(FALSE, NULL); + return; } - return; - } } /* fromX != -1 */ -- 1.7.0.4