From 8bac62c70d682a8dbdb029af5fa80660979821e2 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sat, 22 Aug 2009 17:30:05 -0700 Subject: [PATCH] fix premove for winboard This might fix the illusive premove problem. In 4.2.7 the code was not properly indented, and this led to an unbalanced braces error that I then fixed the wrong way. Click-click premoves did only work after clicking the toSquare twice. It might be that they actually did work after clicking it once, but that the highlights were not displayed (although set) for lack of a display refresh. --- winboard/winboard.c | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-) diff --git a/winboard/winboard.c b/winboard/winboard.c index 21d731d..a17e4ac 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -5140,23 +5140,20 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) ClearHighlights(); } FinishMove(moveType, fromX, fromY, toX, toY, NULLCHAR); - fromX = fromY = -1; if (appData.animate && !appData.highlightLastMove) { ClearHighlights(); DrawPosition(forceFullRepaint || FALSE, NULL); } } - break; + fromX = fromY = -1; + break; } if (gotPremove) { - /* [HGM] it seemed that braces were missing here */ - SetPremoveHighlights(fromX, fromY, toX, toY); - fromX = fromY = -1; - break; - } - } - ClearHighlights(); - DrawPosition(forceFullRepaint || FALSE, NULL); + SetPremoveHighlights(fromX, fromY, toX, toY); + DrawPosition(forceFullRepaint || FALSE, NULL); + } else ClearHighlights(); + fromX = fromY = -1; + DrawPosition(forceFullRepaint || FALSE, NULL); } /* First downclick, or restart on a square with same color piece */ if (!frozen && OKToStartUserMove(x, y)) { -- 1.7.0.4