Skip to content

Commit 7e6f2aa

Browse files
akoch-yattaHeikoKlare
authored andcommitted
[win32] Use deviceZoom in single zoom mapper
This commit replaces the usage of the zoom attribute in methods in the SingleZoomCoordinateMapper that translate Point and Rectangle from and to display coordinates to use DPIUtil.getDeviceZoom() instead. The implementation was not consistent yet, as e.g. in SingleZoomCoordinateMapper#getCursorLocation or SingleZoomCoordinateMapper#setCursorLocation DPIUtil.getDeviceZoom() is already used.
1 parent 20d18aa commit 7e6f2aa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,22 @@ public Rectangle mapMonitorBounds(Rectangle rect, int zoom) {
7777

7878
@Override
7979
public Point translateFromDisplayCoordinates(Point point, int zoom) {
80-
return Win32DPIUtils.pixelToPoint(point, zoom);
80+
return Win32DPIUtils.pixelToPoint(point, DPIUtil.getDeviceZoom());
8181
}
8282

8383
@Override
8484
public Point translateToDisplayCoordinates(Point point, int zoom) {
85-
return Win32DPIUtils.pointToPixel(point, zoom);
85+
return Win32DPIUtils.pointToPixel(point, DPIUtil.getDeviceZoom());
8686
}
8787

8888
@Override
8989
public Rectangle translateFromDisplayCoordinates(Rectangle rect, int zoom) {
90-
return Win32DPIUtils.pixelToPoint(rect, zoom);
90+
return Win32DPIUtils.pixelToPoint(rect, DPIUtil.getDeviceZoom());
9191
}
9292

9393
@Override
9494
public Rectangle translateToDisplayCoordinates(Rectangle rect, int zoom) {
95-
return Win32DPIUtils.pointToPixel(rect, zoom);
95+
return Win32DPIUtils.pointToPixel(rect, DPIUtil.getDeviceZoom());
9696
}
9797

9898
@Override

0 commit comments

Comments
 (0)