RFR: 8318095: TextArea/TextFlow: wrong layout in RTL mode

Andy Goryachev angorya at openjdk.org
Wed Dec 3 22:06:08 UTC 2025


On Wed, 3 Dec 2025 13:34:21 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
>
> Working on a JUnit Test for this bug.

@Ziad-Mid this looks much better, almost complete!
I would like to ask you to test it not only with TextArea, but also with TextFlow - you can use this reproducer https://github.com/andy-goryachev-oracle/Test/blob/main/src/goryachev/bugs/TextFlow_ExtraSpace_8330559.java

Notice how the layout is still not right in some places when the window is resized (the screenshots are from a combined branch of this PR + #1988 but the result is still the same, I think):

<img width="579" height="612" alt="Screenshot 2025-12-03 at 13 27 21" src="https://github.com/user-attachments/assets/161b7ece-0846-47d8-ba69-4a5f6068d53a" />
<img width="686" height="612" alt="Screenshot 2025-12-03 at 13 27 29" src="https://github.com/user-attachments/assets/5b00d994-f45d-4ff4-aee8-fc8cbd93bd61" />



Also, could you try using the monkey tester and try TextArea/TextFlow (and possibly Text/TextField as well) with RTL as well as mixed text.  Please see if you can verify that the layout info is reported correctly, and the shapes are correct.

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

PR Comment: https://git.openjdk.org/jfx/pull/1995#issuecomment-3609033799


More information about the openjfx-dev mailing list