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

    Details

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

      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

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: