Text.getImpl_caretShape() returns wrong shape when Text is not the first child of TextFlow

XMLWordPrintable

    • Type: Bug
    • Resolution: Incomplete
    • Priority: P4
    • None
    • Affects Version/s: 8
    • Component/s: javafx

      The problem is that Text.getImpl_caretShape() obtains TextLayout from the parent TextFlow and then calls TextLayout.getCaretShape(pos, ...) with pos being its internal caret position. The result is getting the caret shape for position pos in the TextFlow, not relative to Text.

      The problematic code in Text.java:

          int pos = getImpl_caretPosition();
          ...
              TextLayout layout = getTextLayout(); // returns parent's TextLayout
              return layout.getCaretShape(pos, bias, x, y);

      I would welcome any solution, e.g. either of
      1) Text.getImpl_caretShape() returns correct caret shape relative to Text;
      2) Text.getImpl_caretShape() return correct caret shape relative to parent TextLayout;
      3) Introduce TextFlow.getImpl_caretShape().

      Thanks,
      Tomas

            Assignee:
            Felipe Heidrich (Inactive)
            Reporter:
            Tomas Mikula
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: