From f522f3f239c2b9ac146edd2f2f94e4622faf8ae1 Mon Sep 17 00:00:00 2001 From: Andreas Koch Date: Mon, 16 Jun 2025 17:27:19 +0200 Subject: [PATCH] [win32] Refetch GC font on demand This commit that the GC always uses the font with the correct zoom in the windows implementation. --- .../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 92636ff4f3f..6199377681e 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 @@ -3947,9 +3947,9 @@ void init(Drawable drawable, GCData data, long hDC) { if (data.nativeZoom == 0) { data.nativeZoom = extractZoom(hDC); } - Font font = data.font; - if (font != null) { + if (data.font != null) { data.state &= ~FONT; + data.font = Font.win32_new(data.font, data.nativeZoom); } else { data.font = SWTFontProvider.getFont(device, OS.GetCurrentObject(hDC, OS.OBJ_FONT), data.nativeZoom); }