RFR: 8242548: Honor line spacing in Labeled reflow calculation

John Hendrikx jhendrikx at openjdk.java.net
Wed Apr 22 15:52:50 UTC 2020


On Wed, 22 Apr 2020 12:51:54 GMT, Ajit Ghaisas <aghaisas at openjdk.org> wrote:

>> This is a solution for 8242548.  There was zero test coverage, so I added a few tests for this as well.
>
> modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/skin/Utils.java line 427:
> 
>> 426:         height += lineSpacing;
>> 427:
>> 428:         String ellipsis = (truncationStyle == CLIP) ? "" : ellipsisString;
> 
> This method makes a call to -
> double eHeight = computeTextHeight(font, ellipsis, 0, boundsType);
> 
> What is the behavior if we make a call to the other method that takes in lineSpacing?
> double eHeight = computeTextHeight(font, ellipsis, 0, lineSpacing, boundsType);

The call only determines the ellipsis height (eHeight) to see if the space is so small that even an ellipsis wouldn't
fit.  For a multi-line ellipsis (if there is such a thing) we could pass in the line spacing here.

-------------

PR: https://git.openjdk.java.net/jfx/pull/173


More information about the openjfx-dev mailing list