X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=9ac6a5830f0e1e0403321996601eed7a26f72f30;hb=fbcf1f3b86b144dd4940b326c32d4b105c0f74b3;hp=80211026275e9d512ea58756da70ce9a13d58235;hpb=94cd32222362d41e436ac6d9d308b397e61c91b8;p=xboard.git diff --git a/backend.c b/backend.c index 8021102..9ac6a58 100644 --- a/backend.c +++ b/backend.c @@ -6932,7 +6932,7 @@ MarkTargetSquares (int clear) for(x=0; x= BOARD_LEFT && x < BOARD_RGHT) clearFlag = 1; // and defer click-click move of empty-square to up-click return; } - if(appData.sweepSelect && HasPromotionChoice(fromX, fromY, toX, toY, &promoChoice, FALSE)) { + if(HasPromotionChoice(fromX, fromY, toX, toY, &promoChoice, FALSE)) { + if(appData.sweepSelect) { ChessSquare piece = boards[currentMove][fromY][fromX]; + ChessSquare victim = boards[currentMove][toY][toX]; + boards[currentMove][toY][toX] = piece; // kludge: make sure there is something to grab for drag DragPieceBegin(xPix, yPix, TRUE); dragging = 1; + boards[currentMove][toY][toX] = victim; promoSweep = defaultPromoChoice; if(PieceToChar(PROMOTED piece) == '+') promoSweep = PROMOTED piece; selectFlag = 0; lastX = xPix; lastY = yPix; Sweep(0); // Pawn that is going to promote: preview promotion piece DisplayMessage("", _("Pull pawn backwards to under-promote")); DrawPosition(FALSE, boards[currentMove]); - return; + } + return; // promo popup appears on up-click } /* Finish clickclick move */ if (appData.animate || appData.highlightLastMove) { @@ -7210,6 +7216,7 @@ LeftClick (ClickType clickType, int xPix, int yPix) /* Don't animate move and drag both */ appData.animate = FALSE; } + MarkTargetSquares(1); // moves into holding are invalid for now (except in EditPosition, adapting to-square) if(x >= 0 && x < BOARD_LEFT || x >= BOARD_RGHT) {