From abd904bfa155a39fc1bb6c43ffc1aafd01fd5ee0 Mon Sep 17 00:00:00 2001 From: Amartya Parijat Date: Wed, 19 Feb 2025 11:45:05 +0100 Subject: [PATCH] Fix Caret Rescaling for win32 #62 This commit fixes caret rescaling by making sure the the field height is updated for every caret and Caret::resize is called for those carets where applicable. contributes to https://github.com/eclipse-platform/eclipse.platform.swt/issues/62 and https://github.com/eclipse-platform/eclipse.platform.swt/issues/127 --- .../Eclipse SWT/win32/org/eclipse/swt/widgets/Caret.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Caret.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Caret.java index 7454187ffee..5f7316bab0f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Caret.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Caret.java @@ -663,9 +663,10 @@ public void setVisible (boolean visible) { */ public static void win32_setHeight(Caret caret, int height) { caret.checkWidget(); - if(caret.height == height && caret.isCurrentCaret()) return; - caret.height = height; - caret.resized = true; + if(caret.height != height) { + caret.height = height; + caret.resized = true; + } if(caret.isVisible && caret.hasFocus()) caret.resize(); }