RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v3]
Karthik P K
kpk at openjdk.org
Thu May 11 06:06:47 UTC 2023
On Tue, 9 May 2023 18:43:07 GMT, Andy Goryachev <angorya at openjdk.org> 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, and whether subsequent HitInfo.getInsertionIndex() would produce a meaningful result.
>
I think it should be possible to initialize insertionIndex always in `getHitInfo()` method. Only scenario now it is not getting initialized is when `lineIndex >= getLineCount()` is true and we don't check for text runs further and initialize `charIndex` using `getCharCount()` method.
I'm not completely clear if removing the `insertionIndex` calculation from `HitInfo.getInsertionIndex()` wouldn't cause any issue. So kept that as well.
Like you mentioned, this can be considered in a separate RFE I think.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1091#issuecomment-1543388818
More information about the openjfx-dev
mailing list