Fix aborted detour under-promotion XB
authorH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 2 Feb 2016 18:18:13 +0000 (19:18 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 2 Feb 2016 18:18:13 +0000 (19:18 +0100)
When a dragged Pawn was released before the promotion piece was fixed,
this would fake a release on the from-square. But the repair of animation
damage would take place on the to-square derived from the actual mouse
coordinates. When this was different from the from-square, the animation
damage (consisting of removalof the piece) would thus not be repaired
by redrawing that square, as normally (when the to-square is different)
it should remain empty. Now we mark the from-square as damaged when the
detour under-promotion changes the dragged piece.

board.c

diff --git a/board.c b/board.c
index 5916d45..e8111dd 100644 (file)
--- a/board.c
+++ b/board.c
@@ -670,6 +670,7 @@ ChangeDragPiece (ChessSquare piece)
 {
   anims[Player].dragPiece = piece;
   SetDragPiece(Player, piece);
 {
   anims[Player].dragPiece = piece;
   SetDragPiece(Player, piece);
+  damage[0][fromY][fromX] = True;
 }
 
 void
 }
 
 void