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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Environment:

      JavaFX 8, b65

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: