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 d91e67746dc..cae89339049 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 @@ -467,8 +467,9 @@ LRESULT CDDS_ITEMPOSTPAINT (NMTVCUSTOMDRAW nmcd, long wParam, long lParam) { if (explorerTheme) { if (hooks (SWT.EraseItem)) { RECT itemRect = item.getBounds (index, true, true, false, false, true, hDC); - itemRect.left -= EXPLORER_EXTRA; - itemRect.right += EXPLORER_EXTRA + 1; + int explorerExtraInPixels = Win32DPIUtils.pointToPixel(EXPLORER_EXTRA, zoom); + itemRect.left -= explorerExtraInPixels; + itemRect.right += explorerExtraInPixels + 1; pClipRect.left = itemRect.left; pClipRect.right = itemRect.right; if (columnCount > 0 && hwndHeader != 0) { @@ -1129,17 +1130,19 @@ LRESULT CDDS_ITEMPREPAINT (NMTVCUSTOMDRAW nmcd, long wParam, long lParam) { selectionForeground = clrText = OS.GetSysColor (OS.COLOR_HIGHLIGHTTEXT); } if (explorerTheme) { + int zoom = getZoom(); if ((style & SWT.FULL_SELECTION) == 0) { RECT pRect = item.getBounds (index, true, true, false, false, false, hDC); RECT pClipRect = item.getBounds (index, true, true, true, false, true, hDC); + int explorerExtraInPixels = Win32DPIUtils.pointToPixel(EXPLORER_EXTRA, zoom); if (measureEvent != null) { pRect.right = Math.min (pClipRect.right, boundsInPixels.x + boundsInPixels.width); } else { - pRect.right += EXPLORER_EXTRA; - pClipRect.right += EXPLORER_EXTRA; + pRect.right += explorerExtraInPixels; + pClipRect.right += explorerExtraInPixels; } - pRect.left -= EXPLORER_EXTRA; - pClipRect.left -= EXPLORER_EXTRA; + pRect.left -= explorerExtraInPixels; + pClipRect.left -= explorerExtraInPixels; long hTheme = OS.OpenThemeData (handle, Display.TREEVIEW, getZoom()); int iStateId = selected ? OS.TREIS_SELECTED : OS.TREIS_HOT; if (OS.GetFocus () != handle && selected && !hot) iStateId = OS.TREIS_SELECTEDNOTFOCUS; @@ -1208,8 +1211,9 @@ LRESULT CDDS_ITEMPREPAINT (NMTVCUSTOMDRAW nmcd, long wParam, long lParam) { OS.SaveDC (hDC); OS.SelectClipRgn (hDC, 0); if (explorerTheme) { - itemRect.left -= EXPLORER_EXTRA; - itemRect.right += EXPLORER_EXTRA; + int explorerExtraInPixels = Win32DPIUtils.pointToPixel(EXPLORER_EXTRA, getZoom()); + itemRect.left -= explorerExtraInPixels; + itemRect.right += explorerExtraInPixels; } //TODO - bug in Windows selection or SWT itemRect /*if (selected)*/ itemRect.right++;