Skip to content

Commit c2c78ac

Browse files
committed
[Win32] Improve pixel-to-point conversion precision
With recent changes to the rounding of pixel-to-point conversions the calculated sizes became too small in several use cases, leading to cut-off elements. This change adapts the rounding method to reduce the number of relevant cut-offs.
1 parent 4722846 commit c2c78ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/Win32DPIUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public static Point pixelToPointAsLocation(Drawable drawable, Point point, int z
124124
}
125125

126126
public static Point pixelToPointAsSize(Point point, int zoom) {
127-
return pixelToPoint(point, zoom, RoundingMode.DOWN);
127+
return pixelToPoint(point, zoom, RoundingMode.ROUND);
128128
}
129129

130130
public static Point pixelToPointAsLocation(Point point, int zoom) {

0 commit comments

Comments
 (0)