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

TextFlow.underlineShape()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • jfx21
    • None
    • javafx
    • b17

      Create a new method to provide underline shape (a line under text in the range), similar to Text.underlineShape():

          /**
           * Returns the shape for the underline in local coordinates.
           *
           * @param start the beginning character index for the range
           * @param end the end character index (non-inclusive) for the range
           * @return an array of {@code PathElement} which can be used to create a {@code Shape}
           * @since 21
           */
          public final PathElement[] underlineShape(int start, int end) {
              return getRange(start, end, TextLayout.TYPE_UNDERLINE);
          }

      FYI.
      The shapes being returned is not a line but a rectangle (moveto + lineto segments). There seems to be somewhat complicated logic that constructs a simple line in TextInputControl.createInputMethodAttributes()

            angorya Andy Goryachev
            angorya Andy Goryachev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: