On Sat, 24 Feb 2024 22:44:05 GMT, John Hendrikx <jhendr...@openjdk.org> wrote:

> The character index, even in your example image above, seems to be relative 
> to the `Text`, not to the `TextFlow` (it is 0, even though there are clearly 
> 10 characters before it belonging to another `Text`), so what exactly do you 
> mean with this?
> 
Yes it is relative to Text. We can calculate it relative to Text because of all 
the information we have now in PrismTextLayout after the modification that has 
been done in this PR. The character index is relative to Text because it is 
requested on Text embedded in TextFlow rather than on TextFlow. Without the 
parameters added to `getHitInfo` it is not possible to know if the character 
index needs to be relative to Text or TextFlow. 
Since the x y coordinates will be relative to Text node when hit test is 
requested on Text node embedded in TextFlow, we will not know that the HitTest 
is requested on second Text node without the parameters added in this PR.
Im not sure what is the confusion here. Please let me know if it is not clear.

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

PR Comment: https://git.openjdk.org/jfx/pull/1323#issuecomment-1963504711

Reply via email to