changeset 1747:570d081dd337

RT-17411: Complex text with Bidi support
author prr
date Tue, 11 Sep 2012 13:59:26 -0700
parents df3029cbea31
children e27fb70af786 53ac6341260d
files javafx-ui-common/src/javafx/scene/text/Text.java
diffstat 1 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-common/src/javafx/scene/text/Text.java	Tue Sep 11 14:47:38 2012 +0200
+++ b/javafx-ui-common/src/javafx/scene/text/Text.java	Tue Sep 11 13:59:26 2012 -0700
@@ -1042,7 +1042,7 @@
     }
 
     /**
-     * caret bias in the content. true means a bias towards forward charcter
+     * caret bias in the content. true means a bias towards forward character
      *
      * @treatAsPrivate implementation detail
      * @deprecated This is an internal API that is not intended
@@ -1109,9 +1109,13 @@
      */
     @Deprecated
     public final HitInfo impl_hitTestChar(Point2D point) {
-        return Toolkit.getToolkit().convertHitInfoToFX(
-            getTextHelper().getHitInfo((float)point.getX(),
-                                      (float)point.getY()));
+        Object hit = getTextHelper().getHitInfo((float)point.getX(),
+                                                (float)point.getY());
+
+        if (hit instanceof HitInfo) return (HitInfo)hit;
+
+        //Delete this in the future.
+        return Toolkit.getToolkit().convertHitInfoToFX(hit);
     }
 
     /**
@@ -1145,8 +1149,8 @@
      */
     private void getDecorationShapes() {
         if (getImpl_caretPosition() >= 0) {
-            //convert insertion postiion into character index
-            int charIndex = getImpl_caretPosition() - ((isImpl_caretBias()) ? 0 : 1);
+            //convert insertion position into character index
+            int charIndex = getImpl_caretPosition();
             Object nativeShape =
                 getTextHelper().getCaretShape(charIndex, isImpl_caretBias());
             setImpl_caretShape(