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

TextFlow.caretShape() ignores inline Nodes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • jfx21
    • javafx

      TextFlow.caretShape() produces incorrect caret paths in the presence of inline Nodes, as can be seen using the Monkey Tester TextFlow Page (see attached screenshots).

      The code that visualizes caret shape iterates over the length of text, appending PathElements obtained from caretShape() for each position in the text:

      TextFlow control = ...
                  for(int i=0; i<len; i++) {
                      PathElement[] es = control.caretShape(i, true);
                      caretPath.getElements().addAll(es);
                  }

      To reproduce, select Text: "Inline Nodes" and check 'show caret path'.

      Monkey Tester:
      https://github.com/andy-goryachev-oracle/Test/blob/main/src/goryachev/monkey/MonkeyTesterApp.java

            lkostyra Lukasz Kostyra
            angorya Andy Goryachev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: