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
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)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- "+" shaped artifacts are rendered on UI Toolkit Buttons when the border radius is over 50%, button's opacity is set to 1 and the border has width
- All references to Sprite Atlas and AssetReferenceAtlasedSprite are removed when migrating Sprite Atlas Mode from V1 to V2
- URP ShadowCaster2D is misplaced and distorted when used with rotated Perspective Camera
- UI mesh is drawn twice when two cameras are used
- The Scene view top menu bar disappears when any Draw Mode other than "Wireframe" is selected in the specific project with a corrupted Material
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