RFR: 8306083: Text.hitTest is incorrect when more than one Text node in TextFlow [v10]

Phil Race prr at openjdk.org
Fri Oct 20 23:09:41 UTC 2023


On Fri, 13 Oct 2023 07:01:51 GMT, Karthik P K <kpk at openjdk.org> wrote:

>> The text run selected in `PrismTextLayout::getHitInfo()` method for character index calculation was not correct when hitTest was invoked for Text node in a TextFlow with more than one Text child. Hence wrong character index value was calculated.
>> 
>> Since only x, y coordinates were available in the above mentioned method, sending the text as a parameter to this method is necessary so as to know if the text run selected for character index calculation is correct. Along with this change modified the `PrismTextLayout::getHitInfo()` method to calculate the correct character index.
>> 
>> Added tests to validate the changes.
>
> Karthik P K has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Review comments

Marked as reviewed by prr (Reviewer).

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

PR Review: https://git.openjdk.org/jfx/pull/1157#pullrequestreview-1690985909


More information about the openjfx-dev mailing list