Fix redrawing of pieces dragged off board (bug #47888)
authorH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 10 May 2016 17:42:09 +0000 (19:42 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 10 May 2016 17:42:09 +0000 (19:42 +0200)
The board was not redrawn after a piece was dragged off board,
leaving the piece 'invisibly' in its original position, and also
leaving the target squares marked.

backend.c

index 6b206ea..2a34146 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -7898,8 +7898,10 @@ LeftClick (ClickType clickType, int xPix, int yPix)
     }
 
     // off-board moves should not be highlighted
-    if(x < 0 || y < 0) ClearHighlights();
-    else ReportClick("put", x, y);
+    if(x < 0 || y < 0) {
+       ClearHighlights();
+       DrawPosition(FALSE, NULL);
+    } else ReportClick("put", x, y);
 
     if(gatingPiece != EmptySquare && gameInfo.variant == VariantSChess) promoChoice = ToLower(PieceToChar(gatingPiece));
  }