RFR: 8172849: Non-intuitive baseline alignment for labeled controls with graphics

Karthik P K kpk at openjdk.org
Wed Mar 15 11:04:33 UTC 2023


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.

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

Commit messages:
 - Fix baseline alignment issue

Changes: https://git.openjdk.org/jfx/pull/1059/files
 Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=1059&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8172849
  Stats: 49 lines in 2 files changed: 46 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jfx/pull/1059.diff
  Fetch: git fetch https://git.openjdk.org/jfx pull/1059/head:pull/1059

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


More information about the openjfx-dev mailing list