Skip to content

Commit 2decaac

Browse files
committed
Fixed Shell::setBounds scaling
This commit contributes to the correct scaling of the Shell using its own zoom on Shell::setBounds call as the scaling of the shell in case of a monitor change is directly handled by the DPI_CHANGED event. contributes to #62 and #127
1 parent e0b4fe9 commit 2decaac

File tree

1 file changed

+1
-1
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1596,7 +1596,7 @@ public void setBounds(Rectangle rect) {
15961596
if (rect == null) error (SWT.ERROR_NULL_ARGUMENT);
15971597
checkWidget ();
15981598
Rectangle boundsInPixels = getDisplay().translateToDisplayCoordinates(rect, getZoom());
1599-
setBoundsInPixels(boundsInPixels.x, boundsInPixels.y, boundsInPixels.width, boundsInPixels.height);
1599+
setBoundsInPixels(boundsInPixels.x, boundsInPixels.y, DPIUtil.scaleUp(rect.width, getZoom()), DPIUtil.scaleUp(rect.height, getZoom()));
16001600
}
16011601

16021602
@Override

0 commit comments

Comments
 (0)