Skip to content

Commit 41ca43e

Browse files
committed
[Win32] Fix wrong width and height in Sash with SWT.SMOOTH when dragging
When dragging a Sash with the SWT.SMOOTH, the width and height of the sash are erroneously scaled up by the current zoom. It is caused by a recent change which replaced a setBoundsInPixels with a setBounds call still using the same pixel-based width and height values. This change adapts the according call to consistently use pixel-based values passed to the setBoundsInPixels method again. Fixes #2329
1 parent f0afb7f commit 41ca43e

File tree

1 file changed

+3
-1
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets

1 file changed

+3
-1
lines changed

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Sash.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,9 @@ LRESULT WM_LBUTTONUP (long wParam, long lParam) {
332332
Rectangle bounds = event.getBounds();
333333
if (event.doit) {
334334
if ((style & SWT.SMOOTH) != 0) {
335-
setBounds (bounds.x, bounds.y, width, height);
335+
int xInPixels = Win32DPIUtils.pointToPixel(bounds.x, getZoom());
336+
int yInPixels = Win32DPIUtils.pointToPixel(bounds.y, getZoom());
337+
setBoundsInPixels (xInPixels, yInPixels, width, height);
336338
// widget could be disposed at this point
337339
}
338340
}

0 commit comments

Comments
 (0)