From: H.G. Muller Date: Mon, 4 Jul 2011 08:45:04 +0000 (+0200) Subject: Improve -showTargetSquares on click-click moves X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=fd1000efa5cb589e1446a4e1cfb0b4d222b0f65d;p=xboard.git Improve -showTargetSquares on click-click moves The markers on move targets are now kept when a first click merely selects a piece, rather than dragging it elsewhere. The second click (by definition on the to-square) then clears the markers. --- diff --git a/backend.c b/backend.c index 15af6e7..e08e829 100644 --- a/backend.c +++ b/backend.c @@ -6805,7 +6805,6 @@ void LeftClick(ClickType clickType, int xPix, int yPix) } if (clickType == Press) ErrorPopDown(); - MarkTargetSquares(1); x = EventToSquare(xPix, BOARD_WIDTH); y = EventToSquare(yPix, BOARD_HEIGHT); @@ -6920,6 +6919,7 @@ void LeftClick(ClickType clickType, int xPix, int yPix) /* Clicked again on same color piece -- changed his mind */ second = (x == fromX && y == fromY); promoDefaultAltered = FALSE; + MarkTargetSquares(1); if(!second || appData.oneClick && !OnlyMove(&x, &y, TRUE)) { if (appData.highlightDragging) { SetHighlights(x, y, -1, -1); @@ -6986,6 +6986,7 @@ void LeftClick(ClickType clickType, int xPix, int yPix) toX = x; toY = y; saveAnimate = appData.animate; + MarkTargetSquares(1); if (clickType == Press) { if(gameMode == EditPosition && boards[currentMove][fromY][fromX] == EmptySquare) { // must be Edit Position mode with empty-square selected