Search Issue Tracker

Fixed in 2.2.0-preview.3, 3.2.0-pre.3

Votes

0

Found in [Package]

3.2.0-pre.1

Issue ID

1361032

Regression

No

"IndexOutOfRangeException" is thrown when selecting overflowing TextMeshPro-Text with Ellipse Overflow enabled

Package: TextMeshPro

-

Steps to reproduce:
1. Open the attached project "TMPBug.zip"
2. Open Scenes>SampleScene
3. Enter the Play Mode
4. Click on the Input Field in the Game View
5. Type any symbol
6. Click on the Input Field in the Game View
7. Observe the Console window

Expected results: No errors are thrown
Actual result: "IndexOutOfRangeException" is thrown

Reproducible with: 2.1.6 (2019.4.30f1), 3.2.0-pre.1 (2020.3.17f1, 2021.1.19f1, 2021.2.0b8, 2022.1.0a7)

Full error:
IndexOutOfRangeException: Index was outside the bounds of the array.
TMPro.TMP_TextUtilities.FindNearestCharacterOnLine (TMPro.TMP_Text text, UnityEngine.Vector3 position, System.Int32 line, UnityEngine.Camera camera, System.Boolean visibleOnly) (at Library/PackageCache/com.unity.textmeshpro@2.1.6/Scripts/Runtime/TMP_TextUtilities.cs:242)
TMPro.TMP_TextUtilities.GetCursorIndexFromPosition (TMPro.TMP_Text textComponent, UnityEngine.Vector3 position, UnityEngine.Camera camera, TMPro.CaretPosition& cursor) (at Library/PackageCache/com.unity.textmeshpro@2.1.6/Scripts/Runtime/TMP_TextUtilities.cs:146)
TMPro.TMP_InputField.OnPointerDown (UnityEngine.EventSystems.PointerEventData eventData) (at Library/PackageCache/com.unity.textmeshpro@2.1.6/Scripts/Runtime/TMP_InputField.cs:1805)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerDownHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:36)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:261)
UnityEngine.EventSystems.EventSystem:Update() (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:377)

  1. Resolution Note (fix version 2.2.0-preview.3, 3.2.0-pre.3):

    Fixed in TextMeshPro 3.2.0-pre.3 available in 2020.3.0f1 and above

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.