On Fri, 30 Jun 2023 17:21:59 GMT, Andy Goryachev <ango...@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

Reply via email to