RFR: 8318095: TextArea/TextFlow: wrong layout in RTL mode [v2]

Andy Goryachev angorya at openjdk.org
Fri Dec 12 18:50:09 UTC 2025


On Thu, 11 Dec 2025 15:32:58 GMT, Ziad El Midaoui <zelmidaoui at openjdk.org> wrote:

>> Fixed issue with TextArea/TextFlow added a check `isMirrored()` in `PrismTextLayout.setWrapWidth` which makes the text right aligned in RTL.
>> Tested with monkeyTester and the test in the bug
>
> Ziad El Midaoui has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fixed incorrect layout when resizing

Excellent work, @Ziad-Mid !

Tested with the reproducer TextFlow_ExtraSpace_8330559 as well as the monkey tester, on macOS 26.1 (there are no platform-specific changes).  I think one reviewer is sufficient.

modules/javafx.graphics/src/main/java/com/sun/javafx/text/PrismTextLayout.java line 1401:

> 1399:             float contentWidth = bounds.getWidth();
> 1400:             if (isMirrored()) {
> 1401:                 float runWidth = 0;

I checked if it makes sense to cache runWidth in the PrismTextLine - it does not, so this implementation is ok.

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

Marked as reviewed by angorya (Reviewer).

PR Review: https://git.openjdk.org/jfx/pull/1995#pullrequestreview-3573138216
PR Review Comment: https://git.openjdk.org/jfx/pull/1995#discussion_r2615224868


More information about the openjfx-dev mailing list