diff options
author | Carsten Hammer | 2020-06-20 17:37:17 +0000 |
---|---|---|
committer | Niraj Modi | 2020-06-23 06:54:02 +0000 |
commit | 5e3aeaaa13cac97cfd6bddbee3dc2642e5ac647a (patch) | |
tree | 74f246a51cd3090988a28a276910642dd639595d | |
parent | 833fd680756ed26c9c33ef4ae7a2beb628ad37ad (diff) | |
download | eclipse.platform.swt-5e3aeaaa13cac97cfd6bddbee3dc2642e5ac647a.tar.gz eclipse.platform.swt-5e3aeaaa13cac97cfd6bddbee3dc2642e5ac647a.tar.xz eclipse.platform.swt-5e3aeaaa13cac97cfd6bddbee3dc2642e5ac647a.zip |
Bug 564504 - Fix scaling
Not sure how it is supposed to be. In
https://git.eclipse.org/r/plugins/gitiles/platform/eclipse.platform.swt/+/e02d49aefe42ac4c77b81048299ab069ddb5c2ba%5E%21/#F33
definitely the changes on getBounds() and getCurrentPoint() do not apply
the scaling to the float array. Maybe the methods are never called and
can be removed completely? Or you *must* not apply it? Maybe they can be
remove but they are public so api...
Change-Id: I830fa135ad1a20ffc975e60033e3b39261dd879a
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java | 4 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Path.java | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java index cbfa1c5ccc..f7558984e0 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java @@ -116,7 +116,7 @@ public static int[] autoScaleDown(Drawable drawable, int[] pointArray) { } /** - * Auto-scale up float array dimensions. + * Auto-scale down float array dimensions. */ public static float[] autoScaleDown (float size[]) { if (deviceZoom == 100 || size == null) return size; @@ -129,7 +129,7 @@ public static float[] autoScaleDown (float size[]) { } /** - * Auto-scale up float array dimensions if enabled for Drawable class. + * Auto-scale down float array dimensions if enabled for Drawable class. */ public static float[] autoScaleDown (Drawable drawable, float size[]) { if (drawable != null && !drawable.isAutoScalable ()) return size; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Path.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Path.java index 249c409c5c..d63865c6d0 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Path.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Path.java @@ -453,7 +453,8 @@ void destroy() { public void getBounds (float[] bounds) { if (bounds == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); getBoundsInPixels(bounds); - bounds = DPIUtil.autoScaleDown(bounds); + float[] scaledbounds= DPIUtil.autoScaleDown(bounds); + System.arraycopy(scaledbounds, 0, bounds, 0, 4); } void getBoundsInPixels(float[] bounds) { @@ -484,7 +485,8 @@ void getBoundsInPixels(float[] bounds) { public void getCurrentPoint (float[] point) { if (point == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); getCurrentPointInPixels(point); - point = DPIUtil.autoScaleDown(point); + float[] scaledpoint= DPIUtil.autoScaleDown(point); + System.arraycopy(scaledpoint, 0, point, 0, 2); } void getCurrentPointInPixels(float[] point) { |