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 cae89339049..73f45dffa13 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 @@ -2964,11 +2964,11 @@ TreeItem getFocusItem () { */ public int getGridLineWidth () { checkWidget (); - return DPIUtil.pixelToPoint(getGridLineWidthInPixels (), getZoom()); + return GRID_WIDTH; } int getGridLineWidthInPixels () { - return GRID_WIDTH; + return Win32DPIUtils.pointToPixel(GRID_WIDTH, getZoom()); } /** @@ -8060,7 +8060,7 @@ LRESULT wmNotifyHeader (NMHDR hdr, long wParam, long lParam) { int deltaX = newItem.cxy - oldItem.cxy; RECT headerRect = new RECT (); OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, phdn.iItem, headerRect); - int gridWidth = linesVisible ? GRID_WIDTH : 0; + int gridWidth = linesVisible ? getGridLineWidthInPixels() : 0; rect.left = headerRect.right - gridWidth; int newX = rect.left + deltaX; rect.right = Math.max (rect.right, rect.left + Math.abs (deltaX)); @@ -8239,7 +8239,7 @@ LRESULT wmNotifyToolTip (NMTTCUSTOMDRAW nmcd, long lParam) { } if (drawForeground) { int nSavedDC = OS.SaveDC (nmcd.hdc); - int gridWidth = getLinesVisible () ? Table.GRID_WIDTH : 0; + int gridWidth = getLinesVisible () ? getGridLineWidthInPixels() : 0; RECT insetRect = toolTipInset (cellRect [0]); OS.SetWindowOrgEx (nmcd.hdc, insetRect.left, insetRect.top, null); GCData data = new GCData (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeColumn.java index 6c7c4c2d79c..844eac0c29b 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeColumn.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeColumn.java @@ -398,7 +398,7 @@ public void pack () { } if (newFont != 0) OS.SelectObject (hDC, oldFont); OS.ReleaseDC (hwnd, hDC); - int gridWidth = parent.linesVisible ? Tree.GRID_WIDTH : 0; + int gridWidth = parent.linesVisible ? parent.getGridLineWidthInPixels() : 0; setWidthInPixels (Math.max (headerWidth, columnWidth + gridWidth)); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java index 36158c18041..426c9ee35ac 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java @@ -530,7 +530,7 @@ RECT getBounds (int index, boolean getText, boolean getImage, boolean fullText, } } } - int gridWidth = parent.linesVisible && columnCount != 0 ? Tree.GRID_WIDTH : 0; + int gridWidth = parent.linesVisible && columnCount != 0 ? parent.getGridLineWidthInPixels() : 0; if (getText || !getImage) { rect.right = Math.max (rect.left, rect.right - gridWidth); }