RFR: 8319844 : Text/TextFlow.hitTest() is incorrect in RTL orientation [v13]
Karthik P K
kpk at openjdk.org
Mon Feb 26 07:54:02 UTC 2024
On Sat, 24 Feb 2024 22:44:05 GMT, John Hendrikx <jhendrikx at 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
More information about the openjfx-dev
mailing list