diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java index 592d5ac01dd..8d631342e8d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java @@ -393,15 +393,6 @@ public static int scaleUp(int size, int zoom) { return Math.round (size * scaleFactor); } -/** - * Auto-scale up int dimensions using Native DPI - */ -public static int autoScaleUpUsingNativeDPI (int size) { - if (nativeDeviceZoom == 100 || size == SWT.DEFAULT) return size; - float nativeScaleFactor = nativeDeviceZoom / 100f; - return Math.round (size * nativeScaleFactor); -} - /** * Auto-scale up int dimensions if enabled for Drawable class. */ diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java index 08d97c8b443..230653fa4e2 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java @@ -1314,7 +1314,7 @@ private int getCheckboxTextOffset(long hdc) { OS.GetThemePartSize(display.hButtonTheme(), hdc, OS.BP_CHECKBOX, OS.CBS_UNCHECKEDNORMAL, null, OS.TS_TRUE, size); result += size.cx; } else { - result += DPIUtil.autoScaleUpUsingNativeDPI(13); + result += DPIUtil.scaleUp(13, nativeZoom); } // Windows uses half width of '0' as checkbox-to-text distance. diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java index d193c028f13..1105dea32c7 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java @@ -1161,7 +1161,7 @@ LRESULT wmMeasureChild (long wParam, long lParam) { * NOTE: autoScaleUpUsingNativeDPI() is used to avoid problems * with applications that disable automatic scaling. */ - struct.itemWidth = DPIUtil.autoScaleUpUsingNativeDPI(5); + struct.itemWidth = DPIUtil.scaleUp(5, nativeZoom); OS.MoveMemory (lParam, struct, MEASUREITEMSTRUCT.sizeof); return null; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java index 1c8e63d156c..9a1b5e5c94c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java @@ -6915,7 +6915,7 @@ LRESULT wmNotifyHeader (NMHDR hdr, long wParam, long lParam) { * Sort indicator size needs to scale as per the Native Windows OS DPI level * when header is custom drawn. For more details refer bug 537097. */ - int leg = DPIUtil.autoScaleUpUsingNativeDPI(3); + int leg = DPIUtil.scaleUp(3, nativeZoom); if (sortDirection == SWT.UP) { OS.Polyline(nmcd.hdc, new int[] {center-leg, 1+leg, center+1, 0}, 2); OS.Polyline(nmcd.hdc, new int[] {center+leg, 1+leg, center-1, 0}, 2); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java index e86675701ab..b87b42087f0 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java @@ -7884,7 +7884,7 @@ LRESULT wmNotifyHeader (NMHDR hdr, long wParam, long lParam) { * Sort indicator size needs to scale as per the Native Windows OS DPI level * when header is custom drawn. For more details refer bug 537097. */ - int leg = DPIUtil.autoScaleUpUsingNativeDPI(3); + int leg = DPIUtil.scaleUp(3, nativeZoom); if (sortDirection == SWT.UP) { OS.Polyline(nmcd.hdc, new int[] {center-leg, 1+leg, center+1, 0}, 2); OS.Polyline(nmcd.hdc, new int[] {center+leg, 1+leg, center-1, 0}, 2);