Skip to content

Commit

Permalink
Using native zoom to compute size for width and height
Browse files Browse the repository at this point in the history
When autoScale is int200 the size compute for width and height is not
scaled correctly during DPI change. Using native zoom instead of
corrected zoom fixes the issue.
  • Loading branch information
ShahzaibIbrahim committed Dec 23, 2024
1 parent 49fd6b0 commit 939aab9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,8 @@ public Point computeSize (int wHint, int hHint) {
public Point computeSize (int wHint, int hHint, boolean changed){
checkWidget ();
int zoom = getZoom();
wHint = (wHint != SWT.DEFAULT ? DPIUtil.scaleUp(wHint, zoom) : wHint);
hHint = (hHint != SWT.DEFAULT ? DPIUtil.scaleUp(hHint, zoom) : hHint);
wHint = (wHint != SWT.DEFAULT ? DPIUtil.scaleUp(wHint, nativeZoom) : wHint);
hHint = (hHint != SWT.DEFAULT ? DPIUtil.scaleUp(hHint, nativeZoom) : hHint);
return DPIUtil.scaleDown(computeSizeInPixels(wHint, hHint, changed), zoom);
}

Expand Down

0 comments on commit 939aab9

Please sign in to comment.