RFR: 8306083: Text.hitTest is incorrect when Text node is present in TextFlow
Karthik P K
kpk at openjdk.org
Wed Jun 21 06:39:28 UTC 2023
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.
-------------
Commit messages:
- Fix character index calculation issue in Text node embedded in TextFlow
Changes: https://git.openjdk.org/jfx/pull/1157/files
Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=1157&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8306083
Stats: 372 lines in 7 files changed: 358 ins; 0 del; 14 mod
Patch: https://git.openjdk.org/jfx/pull/1157.diff
Fetch: git fetch https://git.openjdk.org/jfx.git pull/1157/head:pull/1157
PR: https://git.openjdk.org/jfx/pull/1157
More information about the openjfx-dev
mailing list