RFR: 8319844 : Text/TextFlow.hitTest() is incorrect in RTL orientation [v13]

Karthik P K kpk at openjdk.org
Tue Feb 27 10:02:58 UTC 2024


On Mon, 26 Feb 2024 11:35:06 GMT, Karthik P K <kpk at openjdk.org> wrote:

>> tests/system/src/test/java/test/robot/javafx/scene/RTLTextFlowCharacterIndexTest.java line 238:
>> 
>>> 236: 
>>> 237:     @Test
>>> 238:     public void testTextAndTextFlowHitInfoForRTLEnglishText() throws Exception {
>> 
>> I just replaced `PrismTextLayout#getHitInfo` with `return new Hit(0, 0, true);` and this test, and all the others still pass.
>> 
>> I think the tests should check for a given range of x values if the correct character is being returned as the hit, perhaps more inspired by the tests in https://github.com/openjdk/jfx/pull/1236
>
> I'm not sure if we could write headless test for this. Could you please point me to a test which could be helpful for me?

I believe the tests added in this PR are helpful in making sure that the HitInfo calculation does not give results like character index less than 0 or character index greater than total length of the text or out of bound values. Since each character width is different and we have to check multiple scenarios, it is difficult to write generalised test for each case. Hence a combination of manual test using MonkeyTester and the automated tests added in this PR would be helpful in validating the changes.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1323#discussion_r1503962024


More information about the openjfx-dev mailing list