From 2392a87503272e7ae1dcaa6aa8628955dc5493d1 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Mon, 17 Nov 2014 13:00:37 +0100 Subject: [PATCH] stash --- backend.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/backend.c b/backend.c index f969aba..6bf57ac 100644 --- a/backend.c +++ b/backend.c @@ -7495,7 +7495,7 @@ LeftClick (ClickType clickType, int xPix, int yPix) return; } } - +printf("to click %d,%d\n",x,y); /* fromX != -1 */ if (clickType == Press && gameMode != EditPosition) { ChessSquare fromP; @@ -7558,6 +7558,12 @@ LeftClick (ClickType clickType, int xPix, int yPix) // ignore clicks on holdings if(x < BOARD_LEFT || x >= BOARD_RGHT) return; } +printf("A type=%d\n",clickType); + + if(x == fromX && y == fromY && gameMode == EditPosition && SubtractTimeMarks(&lastClickTime, &prevClickTime) < 200) { + gatingPiece = boards[currentMove][fromY][fromX]; // prepare to copy rather than move + return; + } if (clickType == Release && x == fromX && y == fromY && killX < 0) { DragPieceEnd(xPix, yPix); dragging = 0; @@ -7591,7 +7597,7 @@ LeftClick (ClickType clickType, int xPix, int yPix) } clearFlag = 0; - +printf("B\n"); if(gameMode != EditPosition && !appData.testLegality && !legal[y][x] && fromX >= BOARD_LEFT && fromX < BOARD_RGHT && (x != killX || y != killY) && !sweepSelecting) { if(dragging) DragPieceEnd(xPix, yPix), dragging = 0; @@ -7599,7 +7605,7 @@ LeftClick (ClickType clickType, int xPix, int yPix) DrawPosition(TRUE, NULL); return; // ignore to-click } - +printf("(%d,%d)-(%d,%d) %d %d\n",fromX,fromY,toX,toY,x,y); /* we now have a different from- and (possibly off-board) to-square */ /* Completed move */ if(!sweepSelecting) { -- 1.7.0.4