Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8119761

[Text] Caret shape is in wrong location when at end of RTL text.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8
    • javafx
    • JavaFX 8, b65

      When moving the cursor over pure RTL text in TextField, the caret moves forwards (left-wards) until it hits the last position, i.e. the position after the last character, and then it jumps to the far right again.

      Here is a simple test case:

      import javafx.application.*;
      import javafx.scene.shape.*;
      import javafx.scene.text.*;
      import javafx.stage.*;

      public class TextTest extends Application {

          public static void main(String[] args) { launch(args); }

          @Override public void start(Stage stage) {
              Text text = new Text("\u05E9\u05E0");

              for (int i = 0; i <= text.getText().length(); i++) {
                  text.setImpl_caretPosition(i);
                  System.err.println("caretPos=" + i + ", caretX=" + ((MoveTo)text.getImpl_caretShape()[0]).getX());
              }
              System.exit(0);
          }
      }

      Output:
      caretPos=0, caretX=14.41552734375
      caretPos=1, caretX=5.205078125
      caretPos=2, caretX=14.41552734375

            fheidric Felipe Heidrich (Inactive)
            leifs Leif Samuelsson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: