changeset 1798:c0aff81b30ad

Fixed RT-25479: [TextField] Text input starts from wrong position. Disable caret bias handling util it can be fully supported.
author leifs
date Tue, 09 Oct 2012 10:49:29 -0700
parents fe99329cd02e
children ea00b638cdd6
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextFieldSkin.java
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextFieldSkin.java	Mon Oct 08 12:32:06 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextFieldSkin.java	Tue Oct 09 10:49:29 2012 -0700
@@ -118,7 +118,8 @@
 
         @Override protected void invalidated() {
             if (getWidth() > 0) {
-                textNode.impl_caretBiasProperty().set(get());
+                // RT-25479: Disable caret bias handling for now.
+                // textNode.impl_caretBiasProperty().set(get());
                 updateCaretOff();
             }
         }
@@ -383,7 +384,6 @@
                     Point2D p = new Point2D(caretHandle.getLayoutX() + e.getX() + pressX - textNode.getLayoutX(),
                                             caretHandle.getLayoutY() + e.getY() - pressY - 6);
                     HitInfo hit = textNode.impl_hitTestChar(translateCaretPosition(p));
-                    int pos = hit.getCharIndex();
                     positionCaret(hit, false);
                     e.consume();
                 }
@@ -674,7 +674,8 @@
     }
 
     public void positionCaret(HitInfo hit, boolean select) {
-        int pos = hit.getCharIndex();
+//         int pos = hit.getCharIndex();
+        int pos = hit.getInsertionIndex();
         boolean isNewLine =
                (pos > 0 &&
                 pos < getSkinnable().getLength() &&