RFR: JDK-8314215 Trailing Spaces before Line Breaks Affect the Center Alignment of Text [v11]

John Hendrikx jhendrikx at openjdk.org
Fri Feb 9 10:05:06 UTC 2024


On Fri, 9 Feb 2024 01:33:20 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

> My theory is now that how the wrap width of the `Text` node is updated is not entirely legal (I posted on the mailinglist to see if anyone can remember how this is supposed to work when you update a value (that may cause layout changes) based on a property that is already changed by layout code).

I tested this now by using a `Label` instead of `Text`, setting the `ScrollPane` to `setFitToWidth(true)`, removing the `Group` around the `Label`, and removing the binding that updates wrapping width (which `Label` doesn't have).  A horizontal scroll bar now never appears, and the text seems to always perfectly fit (aside from side bearings which sometimes fall outside the bounds, especially noticeable with italic fonts -- this is considered normal though).

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

PR Comment: https://git.openjdk.org/jfx/pull/1236#issuecomment-1935639938


More information about the openjfx-dev mailing list