RFR: 8306083: Text.hitTest is incorrect when Text node is present in TextFlow [v4]
Karthik P K
kpk at openjdk.org
Tue Aug 8 13:58:40 UTC 2023
On Fri, 30 Jun 2023 14:40:14 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 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.
>
> Karthik P K has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix character index calculation issue
The x coordinate value returned from mouse event is correct and it is not a bug as the x coordinate value is relative to the Text node bounds and not relative to the start of the first character. Hence fixed the character index calculation issue as part of this PR.
Made changes in text as well to wrap Text node content.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1157#issuecomment-1669671252
More information about the openjfx-dev
mailing list