Skip to content

Commit 7ae22a9

Browse files
akoch-yattaHeikoKlare
authored andcommitted
Add DPIUtil method to get device zoom for original autoscale value
The autoscale value may be adapted during runtime, either via explicit methods in DPIUtil or by rewriting the system property. In order to be able to calculate the device zooom for a different autoscale value, such as the initial one, this change adds an according method.
1 parent 180fed3 commit 7ae22a9

File tree

1 file changed

+4
-0
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal

1 file changed

+4
-0
lines changed

bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,10 @@ public static int getDeviceZoom() {
597597
return deviceZoom;
598598
}
599599

600+
public static int getDeviceZoom(String autoScaleProperty) {
601+
return getZoomForAutoscaleProperty(nativeDeviceZoom, autoScaleProperty);
602+
}
603+
600604
public static void setDeviceZoom (int nativeDeviceZoom) {
601605
DPIUtil.nativeDeviceZoom = nativeDeviceZoom;
602606
int deviceZoom = getZoomForAutoscaleProperty (nativeDeviceZoom);

0 commit comments

Comments
 (0)