changeset 5704:026734a0cfa1

RT-33950: Touch: Text selection using mouse from TextArea causes exception
author leifs
date Tue, 12 Nov 2013 16:05:50 -0800
parents 5faf1a0ea511
children 84f914be6ad1
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TextAreaSkin.java
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TextAreaSkin.java	Tue Nov 12 18:55:26 2013 +0200
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TextAreaSkin.java	Tue Nov 12 16:05:50 2013 -0800
@@ -707,7 +707,7 @@
                         // Swap caret and anchor
                         textArea.selectRange(textArea.getCaretPosition(), textArea.getAnchor());
                     }
-                    if (pos >= 0) {
+                    if (pos > 0) {
                         if (pos >= textArea.getAnchor()) {
                             pos = textArea.getAnchor();
                         }
@@ -718,8 +718,8 @@
                             hit.setCharIndex(pos - 1);
                         }
                         textNode.setImpl_caretPosition(oldPos);
-                        positionCaret(hit, true, false);
                     }
+                    positionCaret(hit, true, false);
                     e.consume();
                 }
             });