X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=draw.c;h=badd12baa3c2665c9010e1d506e83444382cdbf4;hb=562bc6ef0a03544438acade21408653cfd1c4075;hp=f89468df2b7f3f878327f48495e0ea152233a864;hpb=95bcf4c69c5c7c40bcecdf5624ca622a9373701e;p=xboard.git diff --git a/draw.c b/draw.c index f89468d..badd12b 100644 --- a/draw.c +++ b/draw.c @@ -175,10 +175,18 @@ InitDrawingSizes (BoardSize boardSize, int flags) int boardWidth, boardHeight; static int oldWidth, oldHeight; static VariantClass oldVariant; - static int oldTwoBoards = 0; + static int oldTwoBoards = 0, oldNrOfFiles = 0; if(!mainOptions[W_BOARD].handle) return; + if(boardSize == -2 && gameInfo.variant != oldVariant + && oldNrOfFiles && oldNrOfFiles != BOARD_WIDTH) { // called because variant switch changed board format + squareSize = ((squareSize + lineGap) * oldNrOfFiles + 0.5*BOARD_WIDTH) / BOARD_WIDTH - lineGap; // keep total width fixed + CreatePNGPieces(); + CreateGrid(); + } + oldNrOfFiles = BOARD_WIDTH; + if(oldTwoBoards && !twoBoards) PopDown(DummyDlg); oldTwoBoards = twoBoards;