Skip to content

Commit baf0993

Browse files
committed
Windows 10/11: Fix the button click area in the property browser shifting
...because the contents were rendered stretched or compressed. Force the window 1 pixel taller and then restore it's original size. This somehow fixes the problem where on Windows 10 and 11 toggling the scroll bar would cause the client area of the text window to be stretched or compressed horizontally. It looks bad and the buttons on the toolbar do not line up with the hit areas. This fix is the result of a long discussion with claude-sonnet-4.6 https://github.com/solvespace/solvespace/agents/pull/1680 solvespace#1680 Fixes: solvespace#681
1 parent cab7fd0 commit baf0993

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ Bug fixes:
8282
* Does not create an invisible zero length edge and jump the intersection point to (0, 0, 0) when splitting lines with coincident end points.
8383
* Fix IDF import with THOU units.
8484
* macOS: Fix some points not draggable on macOS 26 (Tahoe).
85+
* Windows 10/11: Fix the button click area in the property browser shifting because the contents were rendered stretched or compressed.
8586

8687
3.1
8788
---

src/platform/guiwin.cpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,8 +1350,25 @@ class WindowImplWin32 final : public Window {
13501350
}
13511351

13521352
void SetScrollbarVisible(bool visible) override {
1353-
scrollbarVisible = visible;
1354-
sscheck(ShowScrollBar(hWindow, SB_VERT, visible));
1353+
if(scrollbarVisible != visible) {
1354+
scrollbarVisible = visible;
1355+
sscheck(ShowScrollBar(hWindow, SB_VERT, visible));
1356+
// Force the window 1 pixel taller and then restore it's original size.
1357+
// This somehow fixes the problem where on Windows 10 and 11 toggling
1358+
// the scroll bar would cause the client area of the text window to
1359+
// be stretched or compressed horizontally. It looks bad and the
1360+
// buttons on the toolbar do not line up with the hit areas.
1361+
// See: https://github.com/solvespace/solvespace/issues/681
1362+
// This fix is the result of a long discussion with claude-sonnet-4.6
1363+
// https://github.com/solvespace/solvespace/agents/pull/1680
1364+
// https://github.com/solvespace/solvespace/pull/1680
1365+
RECT rc;
1366+
GetWindowRect(hWindow, &rc);
1367+
SetWindowPos(hWindow, HWND_TOP, rc.left, rc.top, rc.right - rc.left,
1368+
rc.bottom - rc.top + 1, SWP_FRAMECHANGED);
1369+
SetWindowPos(hWindow, HWND_TOP, rc.left, rc.top, rc.right - rc.left,
1370+
rc.bottom - rc.top, SWP_FRAMECHANGED);
1371+
}
13551372
}
13561373

13571374
void ConfigureScrollbar(double min, double max, double pageSize) override {

0 commit comments

Comments
 (0)