Skip to main content
Question

Why does the getStyledTextSegments() function return incorrect end value?

  • April 14, 2023
  • 1 reply
  • 242 views

aamir.shaikh


TextNode.getStyledTextSegments([‘fontName’]) returns incorrect end value. Here, the word is ‘Spline’, which contains 6 characters. So, the end number should be 5, since we are starting from 0.

This topic has been closed for replies.

1 reply

tank666
  • April 14, 2023

Everything is correct here. Starting from 0 to 6. Where 0—position before the text characters; 6—position after text characters.

But what if you entered only one character, then the start would be equal to the end, i.e. 0? This is fundamentally wrong.