TextFlow.caretShape() ignores inline Nodes

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P3
    • None
    • Affects Version/s: jfx21
    • Component/s: 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

        1. Screenshot 2023-03-27 at 16.15.15.png
          24 kB
          Andy Goryachev
        2. Screenshot 2023-03-27 at 16.15.31.png
          21 kB
          Andy Goryachev
        3. Screenshot 2023-03-27 at 16.15.41.png
          22 kB
          Andy Goryachev
        4. Screenshot 2023-03-27 at 16.25.15.png
          158 kB
          Andy Goryachev
        5. Screenshot 2023-05-04 at 14.54.50.png
          434 kB
          Andy Goryachev

            Assignee:
            Lukasz Kostyra
            Reporter:
            Andy Goryachev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: