From 1251e4d2bd5ff562f337e6638db71d21696b54cc Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 15 Oct 2012 10:27:14 +0200 Subject: [PATCH] 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. --- xboard.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) 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; -- 1.7.0.4