RFR: 8306083: Text.hitTest is incorrect when Text node is present in TextFlow [v4]
Karthik P K
kpk at openjdk.org
Sun Jul 2 09:57:00 UTC 2023
On Fri, 30 Jun 2023 17:21:59 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
> Do you mean MouseVent.getX()?
The x coordinate reported by `MouseEvent.getPickResult().getIntersectedPoint()` method. I can reproduce this issue in MonkeyTester as well. When I checked the `Point2D` object sent to `Text::hitTest()` method, it is different when RichText is displayed in multiple lines like how it is shown in the above screenshot and when it is displayed in single line as shown below.
<img width="1312" alt="image" src="https://github.com/openjdk/jfx/assets/26969459/a85018f9-3452-4ffb-abe0-7f540b44bb56">
In both the cases cursor is hovered just over the right side of caret line. The x coordinate value reported is given below.
Single line - x: 102
Multi line - x: 1
Because of this issue, the character index calculated for the same character changes.
However I agree that bug is present in the character index calculation like you mentioned above. I'll work on fixing that.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1157#issuecomment-1616556353
More information about the openjfx-dev
mailing list