For boards with other than 8 files the squares will be scaled different
from what the sizeDefaults say, so that the font and menu clipping
determined by the latter will match the total board width. We now pick
the boardSize after sizing such that popup with an 8-wide board next time
would reproduce the board width.
lg = sqx < 37 ? 1 : sqx < 59 ? 2 : sqx < 116 ? 3 : 4;
if(sqx == oldSqx + 1 && lg == lineGap + 1) sqx = oldSqx, squareSize = 0; // prevent oscillations, force resize by kludge
}
- for(h=0; sizeDefaults[h].name && sizeDefaults[h].squareSize > sqx; h++) {}
+ for(h=0; sizeDefaults[h].name && sizeDefaults[h].squareSize*8 > sqx*BOARD_WIDTH; h++) {}
if(!strchr(appData.boardSize, ',')) {
ASSIGN(appData.boardSize, sizeDefaults[h].name);
initialSquareSize = sizeDefaults[h].squareSize; // used for saving font