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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: P4 P4
    • None
    • 8
    • 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

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

              Created:
              Updated:
              Resolved:
              Imported: