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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
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