RFR: 8306083: Text.hitTest is incorrect when Text node is present in TextFlow [v3]
Karthik P K
kpk at openjdk.org
Wed Jun 28 05:27:18 UTC 2023
On Tue, 27 Jun 2023 17:56:09 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
> right. in the case of the (highlighted) emoji character - the insertion index starts with 0 which I think cannot be correct, because all of the text should be added as a single Text instance, see
>
If a Text node's content is wrapped, then character index will start from 0 again in the new line or do we expect it to be relative to text node and continue with character index from previous line?
If the latter behavior is expected then I couldn't find a way to differentiate between a text node which is wrapped and which is not.
Even if warp information is available, the `getOffsetAtX` method returns the offset (character index) based on the x coordinate value which is relative to the new line. If we use run's start value along with the offset, then we get absolute value of character index relative to textflow. So it looks to me that if a Text node's content is wrapped, then character index in the new line will start from 0. In this case insertion index starting from 0 looks to be correct.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1157#issuecomment-1610759317
More information about the openjfx-dev
mailing list