From: H.G. Muller Date: Fri, 29 May 2009 05:11:11 +0000 (-0700) Subject: corrected 'animate dragging' X-Git-Tag: v4.4.0.alpha3~2 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=d5af04589d5c9195e0e3488ab9531757c3d86249;p=xboard.git corrected 'animate dragging' I finally figured out how the 'animate dragging' works in XBoard, so that I could add code to do the unstacking of multiple pieces in the holdings, rather than always leaving an empty square while you drag them. (And then suddenly re-growing the remaining pieces as you make the drop.) It does not look as fancy as in WinBoard yet, because the counts still only decrease when you release the piece, rather than when you lift it. But this is not nearly as disturbing as leaving empty holdings (if only temporarily) when you still have pieces there. --- diff --git a/xboard.c b/xboard.c index 94c59d1..2b14ef9 100644 --- a/xboard.c +++ b/xboard.c @@ -9143,6 +9143,11 @@ DragPieceBegin(x, y) /* Mark this square as needing to be redrawn. Note that we don't remove the piece though, since logically (ie as seen by opponent) the move hasn't been made yet. */ + if(boardX == BOARD_RGHT+1 && PieceForSquare(boardX-1, boardY) > 1 || + boardX == BOARD_LEFT-2 && PieceForSquare(boardX+1, boardY) > 1) + XCopyArea(xDisplay, xBoardWindow, player.saveBuf, player.blitGC, + corner.x, corner.y, squareSize, squareSize, + 0, 0); // [HGM] xh: unstack in stead of grab damage[boardY][boardX] = True; } else { player.dragActive = False;