RFR: 8230833: LabeledSkinBase computes wrong height with ContentDisplay.GRAPHIC_ONLY [v2]

Karthik P K kpk at openjdk.org
Thu Jan 19 06:12:41 UTC 2023


On Wed, 18 Jan 2023 06:56:57 GMT, Karthik P K <kpk at openjdk.org> wrote:

>> Ignore text condition was not considered in `computePrefHeight` method while calculating the Label height.
>> 
>> Added `isIgnoreText` condition in `computePrefHeight` method while calculating Label height.
>> 
>> Tests are present for all the ContentDisplay types. Modified tests which were failing because of the new height value getting calculated.
>
> Karthik P K has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Use width while calling prefHeight method. Use graphicHeight instead of multiple calls to prefHeight

Expected values of tests listed below have been changed in this PR. Justification for the change is given below.

When text is null or empty, it is considered as ignore text (GRAPHIC_ONLY) condition. So only graphic height along with top and bottom inset value should be considered for height calculation. Hence changed tests are:

1. whenTextIsNullAndGraphicIsSetWithTOPContentDisplay_computePrefHeight_ReturnsRightAnswer
2. whenTextIsEmptyAndGraphicIsSetWithTOPContentDisplay_computePrefHeight_ReturnsRightAnswer
3. whenTextIsNullAndGraphicIsSetWithBOTTOMContentDisplay_computePrefHeight_ReturnsRightAnswer
4. whenTextIsEmptyAndGraphicIsSetWithBOTTOMContentDisplay_computePrefHeight_ReturnsRightAnswer
5. whenTextIsNullAndGraphicIsSetWithTOPContentDisplay_computeMaxHeight_ReturnsRightAnswer
6. whenTextIsEmptyAndGraphicIsSetWithTOPContentDisplay_computeMaxHeight_ReturnsRightAnswer
7. whenTextIsNullAndGraphicIsSetWithBOTTOMContentDisplay_computeMaxHeight_ReturnsRightAnswer
8. whenTextIsEmptyAndGraphicIsSetWithBOTTOMContentDisplay_computeMaxHeight_ReturnsRightAnswer

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

PR: https://git.openjdk.org/jfx/pull/996


More information about the openjfx-dev mailing list