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

Details

    • Bug
    • Resolution: Incomplete
    • P4
    • None
    • 8
    • javafx

    Description

      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

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:
                Imported: