From: H.G. Muller Date: Mon, 15 Oct 2012 08:27:14 +0000 (+0200) Subject: Trim board-window size X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=1251e4d2bd5ff562f337e6638db71d21696b54cc;p=xboard.git Trim board-window size The board window will sometimes be a pixel larger than requested. The ReSize routine will now reset the size values in the Graph Option to what they were supposed to be, to prevent expose events will draw nonsense in the extra space. --- diff --git a/xboard.c b/xboard.c index c6f0c80..3e8de0b 100644 --- a/xboard.c +++ b/xboard.c @@ -1724,7 +1724,7 @@ CoDrag (Widget sh, WindowPlacement *wp) void ReSize (WindowPlacement *wp) { - int sqx, sqy; + int sqx, sqy, w, h; if(wp->width == wpMain.width && wp->height == wpMain.height) return; // not sized sqx = (wp->width - lineGap - marginW) / BOARD_WIDTH - lineGap; sqy = (wp->height - lineGap - marginH) / BOARD_HEIGHT - lineGap; @@ -1734,6 +1734,10 @@ ReSize (WindowPlacement *wp) CreatePNGPieces(); // make newly scaled pieces InitDrawingSizes(0, 0); // creates grid etc. } else ResizeBoardWindow(BOARD_WIDTH * (squareSize + lineGap) + lineGap, BOARD_HEIGHT * (squareSize + lineGap) + lineGap, 0); + w = BOARD_WIDTH * (squareSize + lineGap) + lineGap; + h = BOARD_HEIGHT * (squareSize + lineGap) + lineGap; + if(optList->max > w) optList->max = w; + if(optList->value > h) optList->value = h; } static XtIntervalId delayedDragID = 0;