RFR: 8242548: Honor line spacing in Labeled reflow calculation
Ajit Ghaisas
aghaisas at openjdk.java.net
Wed Apr 22 12:54:59 UTC 2020
On Sun, 12 Apr 2020 21:21:07 GMT, John Hendrikx <jhendrikx 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 426:
> 425:
> 426: height += lineSpacing;
> 427:
Modifying 'height' parameter seems incorrect as this parameter is used in other calculations below. If needed, use a
separate local variable to use 'height+lineSpacing'
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);
-------------
PR: https://git.openjdk.java.net/jfx/pull/173
More information about the openjfx-dev
mailing list