On Tue, 27 Jun 2023 17:56:09 GMT, Andy Goryachev <ango...@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

Reply via email to