RFR: 8172849: Non-intuitive baseline alignment for labeled controls with graphics
Andy Goryachev
angorya at openjdk.org
Wed Mar 15 19:01:34 UTC 2023
On Wed, 15 Mar 2023 10:58:14 GMT, Karthik P K <kpk at openjdk.org> wrote:
> Issue was observed because even when graphic height was less than text height of the Label, graphic height was considered while calculating the baseline offset. This was shifting the baseline offset and resulted in misalignment.
>
> Updated `computeBaselineOffset` to exclude graphic height from baseline offset calculation when graphic height is more than text height.
>
> Added unit test to validate the fix.
Verified the fix with the MonkeyTester.
modules/javafx.controls/src/test/java/test/javafx/scene/control/skin/LabelSkinTest.java line 2102:
> 2100: ********************************************************************/
> 2101:
> 2102: //Test for JDK-8172849
minor: I would have used a javadoc comment instead of the big comment block
/** Test for JDK-8172849 */
modules/javafx.controls/src/test/java/test/javafx/scene/control/skin/LabelSkinTest.java line 2136:
> 2134: * *
> 2135: *******************************************************************************/
> 2136:
Minor: I would have used a javadoc explaining the purpose of this class instead of generic "Helper classes".
-------------
PR: https://git.openjdk.org/jfx/pull/1059
More information about the openjfx-dev
mailing list