On Wed, 21 Jun 2023 22:59:41 GMT, Andy Goryachev <ango...@openjdk.org> wrote:

>> The text run selected in `PrismTextLayout::getHitInfo()` method for 
>> character index calculation was not correct when Text node was embedded in 
>> TextFlow. Hence wrong character index value was calculated for the same.
>> 
>> 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.
>
> Looks like Text.hitTest() does not return the right information (charIndex=0, 
> leading) for text on either the second line, or a wrapped line.  (mouse over 
> over 2nd/3rd lines):
> 
> ![Screenshot 2023-06-21 at 15 56 
> 30](https://github.com/openjdk/jfx/assets/107069028/19ed50e0-453d-4aea-8683-ef1e1ff95e64)

Thanks for pointing out the issue @andy-goryachev-oracle .
It works when content of one Text node exceeds one line or is wrapped but this 
is not working when more than one node is present in TextFlow and nodes exceeds 
one line. This is an issue. I will look into this.

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

PR Comment: https://git.openjdk.org/jfx/pull/1157#issuecomment-1602055806

Reply via email to