On Fri, 12 May 2023 21:05:27 GMT, Andy Goryachev wrote:
> Just by looking at the code, the code paths that leave `insertionIndex=-1` in
> `PrismTextLayout.getHitInfo()` are on lines: 431, 450(when run==null), 472
>
> If we can initialize insertionIndex to a positive value, then the buggy code
On Tue, 9 May 2023 05:10:25 GMT, Karthik P K wrote:
>> Since surrogate pairs are internally considered as 2 characters and text
>> field is null in `HitInfo` when `getInsertionIndex` is invoked from
>> `TextFlow`, wrong insertion index was returned.
>>
>> Updated code to calculate insertion in
On Tue, 9 May 2023 18:16:09 GMT, Andy Goryachev wrote:
>> Karthik P K has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Address code review
>
> modules/javafx.graphics/src/main/java/com/sun/javafx/text/PrismTextLayout.java
> line 425:
>
On Tue, 9 May 2023 18:43:07 GMT, Andy Goryachev wrote:
> There is one question whether it's possible to always initialize
> HitInfo.insertionIndex and remove the secondary computation from
> HitInfo.getInsertionIndex()
>
> I am not clear under which conditions it is not possible to initialize,
On Tue, 9 May 2023 05:10:25 GMT, Karthik P K wrote:
>> Since surrogate pairs are internally considered as 2 characters and text
>> field is null in `HitInfo` when `getInsertionIndex` is invoked from
>> `TextFlow`, wrong insertion index was returned.
>>
>> Updated code to calculate insertion in
> Since surrogate pairs are internally considered as 2 characters and text
> field is null in `HitInfo` when `getInsertionIndex` is invoked from
> `TextFlow`, wrong insertion index was returned.
>
> Updated code to calculate insertion index in `getHitInfo` method of
> `PrismTextLayout` class wh