Skip to content

Commit

Permalink
Fixed Shell::setBounds scaling
Browse files Browse the repository at this point in the history
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
  • Loading branch information
amartya4256 committed Jan 16, 2025
1 parent e0b4fe9 commit 25b6b08
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1596,7 +1596,7 @@ public void setBounds(Rectangle rect) {
if (rect == null) error (SWT.ERROR_NULL_ARGUMENT);
checkWidget ();
Rectangle boundsInPixels = getDisplay().translateToDisplayCoordinates(rect, getZoom());
setBoundsInPixels(boundsInPixels.x, boundsInPixels.y, boundsInPixels.width, boundsInPixels.height);
setBoundsInPixels(boundsInPixels.x, boundsInPixels.y, DPIUtil.scaleUp(rect.width, getZoom()), DPIUtil.scaleUp(rect.height, getZoom()));
}

@Override
Expand Down

0 comments on commit 25b6b08

Please sign in to comment.