Skip to content

Commit

Permalink
Scale up magic number in Button
Browse files Browse the repository at this point in the history
Use DPIUtil
Contributes to vi-eclipse/Eclipse-Platform#72
  • Loading branch information
jakub-suliga committed Jul 17, 2024
1 parent 51e85e0 commit 1106560
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,10 @@ else if ((style & SWT.RIGHT) != 0) {
Rectangle rect = DPIUtil.scaleBounds(image.getBounds(), this.getZoom(), 100);
width = rect.width;
if (hasText && text.length () != 0) {
width += MARGIN * 2;
width += DPIUtil.scaleUp(MARGIN * 2, getZoom());;
}
height = rect.height;
extra = MARGIN * 2;
extra = DPIUtil.scaleUp(MARGIN * 2, getZoom());;
}
}
if (hasText) {
Expand All @@ -378,7 +378,7 @@ else if ((style & SWT.RIGHT) != 0) {
if (length == 0) {
height = Math.max (height, lptm.tmHeight);
} else {
extra = Math.max (MARGIN * 2, lptm.tmAveCharWidth);
extra = Math.max (DPIUtil.scaleUp(MARGIN * 2, getZoom()), lptm.tmAveCharWidth);
char [] buffer = text.toCharArray ();
RECT rect = new RECT ();
int flags = OS.DT_CALCRECT | OS.DT_SINGLELINE;
Expand Down

0 comments on commit 1106560

Please sign in to comment.