diff options
author | Waqas Ilyas | 2019-07-17 19:24:06 +0000 |
---|---|---|
committer | Niraj Modi | 2019-08-05 07:52:23 +0000 |
commit | 66ca6a1630ac2dff01571775a0c1c985b3debfef (patch) | |
tree | d5802da04ec72231730d01c46b77da0ae6d654d2 | |
parent | e264185861853b702bbb62ff8a2877738151104f (diff) | |
download | eclipse.platform.swt-66ca6a1630ac2dff01571775a0c1c985b3debfef.tar.gz eclipse.platform.swt-66ca6a1630ac2dff01571775a0c1c985b3debfef.tar.xz eclipse.platform.swt-66ca6a1630ac2dff01571775a0c1c985b3debfef.zip |
Bug 496849: [win32] Fixed text position for scaled images in Tree
Change-Id: If82ad24d4d545779fe3325b6df17590738e0354c
Signed-off-by: Waqas Ilyas <waqas.ilyas@gmail.com>
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java index dcd82269aa..9f5e8f3295 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java @@ -772,7 +772,7 @@ LRESULT CDDS_ITEMPOSTPAINT (NMTVCUSTOMDRAW nmcd, long wParam, long lParam) { if (size == null) size = DPIUtil.autoScaleDown (getImageSize ()); // To Points if (!ignoreDrawForeground) { //int y1 = rect.top + (index == 0 ? (getItemHeight () - size.y) / 2 : 0); - int y1 = rect.top; + int y1 = rect.top + DPIUtil.autoScaleUp((getItemHeight () - size.y) / 2); int x1 = Math.max (rect.left, rect.left - inset + 1); GCData data = new GCData(); data.device = display; @@ -782,7 +782,7 @@ LRESULT CDDS_ITEMPOSTPAINT (NMTVCUSTOMDRAW nmcd, long wParam, long lParam) { OS.SelectClipRgn (hDC, 0); gc.dispose (); } - OS.SetRect (rect, rect.left + size.x + offset, rect.top, rect.right - inset, rect.bottom); + OS.SetRect (rect, rect.left + DPIUtil.autoScaleUp(size.x) + offset, rect.top, rect.right - inset, rect.bottom); } else { if (i == 0) { if (OS.SendMessage (handle, OS.TVM_GETIMAGELIST, OS.TVSIL_NORMAL, 0) != 0) { |