Search Unity

Possible small bug? number of chars in text component always higher than expected (by 1)

Discussion in 'UGUI & TextMesh Pro' started by Breyer, Aug 22, 2014.

  1. Breyer

    Breyer

    Joined:
    Nov 10, 2012
    Posts:
    412
    I debugged cachedTextGenerator in Menu 3D demo for understanding how UICharsInfo.cursorPos work and, in the meantime, i found that charactersCount is always number of chars in text field+1. This is expected?
     
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    We append a new line on the end internally, this is why the size is +1. It might not be correct but it's the way it is at the moment.