Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v3]

2023-05-15 Thread Karthik P K
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

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v3]

2023-05-12 Thread Andy Goryachev
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

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v3]

2023-05-10 Thread Karthik P K
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: >

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v3]

2023-05-10 Thread Karthik P K
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,

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v3]

2023-05-09 Thread Andy Goryachev
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

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v3]

2023-05-08 Thread Karthik P K
> 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