On Wed, 20 Sep 2023 17:46:24 GMT, Phil Race <p...@openjdk.org> wrote:
> (1) If you are looking for a particular match of text, what if there are 2 > lines or spans that have the exact same text ? If 2 runs have the same text as it can happen in the case of emojis, line number will be calculated correctly. But if 2 text nodes have the exact same text and both are present in the same line, the character index calculation fails. I will check this case. >(2) What is that the logic behind this line ? At least currently you only pass >in text for a Text node. Can you break down what exactly it is doing ? The line index calculation was failing for the Text node. In the case of Text node, even before the actual text line/run is reached, `bottom > y` was becoming true since it is relative to the text node. Hence added this condition of `r.getTextSpan().getText().equals(text)` to make sure that line index is calculated for the correct Text node. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1157#discussion_r1343847876