changeset 4853:089d0e8cb4d6

RT-31349: TextField, bidi text drifts when caret moves to bidi boundary.
author leifs
date Fri, 30 Aug 2013 14:37:15 -0700
parents 98073a78b861
children a11427375c9b
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TextFieldSkin.java
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TextFieldSkin.java	Fri Aug 30 11:17:24 2013 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TextFieldSkin.java	Fri Aug 30 14:37:15 2013 -0700
@@ -240,9 +240,11 @@
                 if (caretPath.getElements().size() == 0) {
                     // The caret pos is invalid.
                     updateTextNodeCaretPos(textField.getCaretPosition());
-                    return;
+                } else if (caretPath.getElements().size() == 4) {
+                    // The caret is split. Ignore and keep the previous width value.
+                } else {
+                    caretWidth = Math.round(caretPath.getLayoutBounds().getWidth());
                 }
-                caretWidth = Math.round(caretPath.getLayoutBounds().getWidth());
             }
         });