Skip to content

Commit 3e04710

Browse files
committed
[win32] fix getting checkbox size from OS
This commit fixes fetching the checkbox size for custom drawn checkbox buttons. Instead of using the zoom adjusted by the swt.autoScale setting the native zoom is used. This is neccessary, because the checkbox will be drawn by the OS and therefore is matching the native zoom as well. Fixes #1573
1 parent df66a8b commit 3e04710

File tree

1 file changed

+1
-1
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets

1 file changed

+1
-1
lines changed

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@ private int getCheckboxTextOffset(long hdc) {
13111311
SIZE size = new SIZE();
13121312

13131313
if (OS.IsAppThemed ()) {
1314-
OS.GetThemePartSize(display.hButtonTheme(getZoom()), hdc, OS.BP_CHECKBOX, OS.CBS_UNCHECKEDNORMAL, null, OS.TS_TRUE, size);
1314+
OS.GetThemePartSize(display.hButtonTheme(nativeZoom), hdc, OS.BP_CHECKBOX, OS.CBS_UNCHECKEDNORMAL, null, OS.TS_TRUE, size);
13151315
result += size.cx;
13161316
} else {
13171317
result += DPIUtil.scaleUp(13, nativeZoom);

0 commit comments

Comments
 (0)