Skip to content

Commit 41e45fd

Browse files
committed
[win32] Make Font#extractZoom device independent
This commit ensures Font#extractZoom is device independent. The previous logic didn't provide any advantages anymore after the conversion between points and pixels was changed for Fonts. By using DPIUtil#getNativeZoom the most probable value for the zoom of a new font a chosen.
1 parent 329ed24 commit 41e45fd

File tree

1 file changed

+2
-2
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics

1 file changed

+2
-2
lines changed

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Font.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,9 @@ public String toString () {
296296

297297
private static int extractZoom(Device device) {
298298
if (device == null) {
299-
return DPIUtil.getNativeDeviceZoom();
299+
System.out.println ("***WARNING: Initializing a font with a null device will use the default device and can lead to errors when this font is used with another device."); //$NON-NLS-1$
300300
}
301-
return device.getDeviceZoom();
301+
return DPIUtil.getNativeDeviceZoom();
302302
}
303303

304304
/**

0 commit comments

Comments
 (0)