From 62c08fde466734bad6675eb278fb6fae57031266 Mon Sep 17 00:00:00 2001 From: Andreas Koch Date: Mon, 5 May 2025 11:27:01 +0200 Subject: [PATCH] [win32] Prevent loop with fix swt.autoScale value This commit adapts the extraction of the correct image handle in the windows implementation when using an Image with a GC. As the image will always pass the exact zoom it needs to the GC using the autoscaled zoom together with an Image can lead to unexpected results when fixed values for swt.autoScale are passed, e.g. scaling ImageData can result in endless loops. --- .../Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java index fd4035c5292..42c527d985f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java @@ -3909,7 +3909,7 @@ void init(Drawable drawable, GCData data, long hDC) { } Image image = data.image; if (image != null) { - data.hNullBitmap = OS.SelectObject(hDC, Image.win32_getHandle(image, DPIUtil.getZoomForAutoscaleProperty(data.nativeZoom))); + data.hNullBitmap = OS.SelectObject(hDC, Image.win32_getHandle(image, data.nativeZoom)); image.memGC = this; } int layout = data.layout;