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

Andy Goryachev angorya at openjdk.org
Mon Feb 26 16:25:51 UTC 2024


On Mon, 26 Feb 2024 10:40:03 GMT, Karthik P K <kpk at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/java/com/sun/javafx/text/PrismTextLayout.java line 606:
>> 
>>> 604:             boolean addLtrIdx = run.getTextSpan().getText().length() != run.length;
>>> 605:             if (r.getStart() != curRunStart && !r.isLinebreak() && addLtrIdx
>>> 606:                     && r.getTextSpan().getText().equals(text)) {
>> 
>> I'm concerned about this check: `r.getTextSpan().getText().equals(text)` -- it seems to me that it either must be irrelevant, or it if is relevant, what if I have many `Text` nodes in a `TextFlow` that happen to have the same text? Let's say I have an English text, where I give each word its own `Text` node in a `TextFlow`.  There would be many duplicates... so I find it hard to believe this check could accomplish anything.
>
> You are right. It fails when there are repeated text nodes. I will look into this

yes, this bothered me from the start.  I did have a test case in the MT with two text nodes with the same text, and it seemed to work correctly.  or did I miss something?

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

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


More information about the openjfx-dev mailing list