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

Karthik P K kpk at openjdk.org
Thu Jan 11 10:31:39 UTC 2024


On Wed, 10 Jan 2024 20:31:43 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/java/javafx/scene/text/TextFlow.java line 202:
>> 
>>> 200:             double x = point.getX();
>>> 201:             double y = point.getY();
>>> 202:             TextLayout.Hit h = layout.getHitInfo((float)x, (float)y, null, -1, -1);
>> 
>> -1 looks like magic value, could you please describe it in the `com.sun.javafx.scene.tex.TextLayout` javadoc in both cases (textRunStart and curRunStart)?
>
> or, would it make more sense to simply pass a boolean flag instead of magic values?

I changed 0 to -1 to figure out if the `getHitInfo` in `PrismTextLayout` is invoked by `Text` or `TextFlow`.
Added comment regarding this in `com.sun.javafx.scene.tex.TextLayout`.

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

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


More information about the openjfx-dev mailing list