From ba12ac5e226e456f8efb66f50b9df4c0fea0befa Mon Sep 17 00:00:00 2001 From: arunjose696 Date: Fri, 1 Aug 2025 18:07:15 +0200 Subject: [PATCH] Revert usage of getZoom() when calculating TextExtent This issue reverts the behavior of GC::textExtent to use the GC::getZoom() instead of the zoom from the font as this results in a regression. Fixes #2361 --- .../Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 4b0c4785994..cd4f197b702 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 @@ -5725,7 +5725,7 @@ void apply() { */ public Point stringExtent (String string) { if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); - return Win32DPIUtils.pixelToPoint(drawable, stringExtentInPixels(string), data.font.zoom); + return Win32DPIUtils.pixelToPoint(drawable, stringExtentInPixels(string), getZoom()); } Point stringExtentInPixels (String string) { @@ -5805,7 +5805,7 @@ public Point textExtent (String string) { * */ public Point textExtent (String string, int flags) { - return Win32DPIUtils.pixelToPoint(drawable, textExtentInPixels(string, flags), data.font.zoom); + return Win32DPIUtils.pixelToPoint(drawable, textExtentInPixels(string, flags), getZoom()); } Point textExtentInPixels(String string, int flags) {