Skip to content

Commit cb67a30

Browse files
committed
FIX: Rescaling a rectangle should only consider current and target zoom
As current and target zoom are given as parameters, the scaling must not be skipped if the cached value in deviceZoom equals 100, but only the given values must be used for it.
1 parent 27998ef commit cb67a30

File tree

1 file changed

+1
-1
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal

1 file changed

+1
-1
lines changed

bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ private static ImageData autoScaleImageData (Device device, final ImageData imag
280280
* Returns a new rectangle as per the scaleFactor.
281281
*/
282282
public static Rectangle autoScaleBounds (Rectangle rect, int targetZoom, int currentZoom) {
283-
if (deviceZoom == 100 || rect == null || targetZoom == currentZoom) return rect;
283+
if (rect == null || targetZoom == currentZoom) return rect;
284284
float scaleFactor = ((float)targetZoom) / (float)currentZoom;
285285
Rectangle returnRect = new Rectangle (0,0,0,0);
286286
returnRect.x = Math.round (rect.x * scaleFactor);

0 commit comments

Comments
 (0)