Search Issue Tracker

Fixed

Fixed in 3.2.x

Votes

1

Found in [Package]

3.2.x

Issue ID

TMPB-198

Regression

Yes

[TMP] [UGUI] Incorrectly calculating rect size when using <size> tag

Package: TextMeshPro

-

Reproduction steps:
1. Open the attached project "TMP bug"
2. Open the “/Assets/Scenes/SampleScene.unity” Scene
3. Observe the Game View

Expected result: Text is shown inside the Canvas as seen in NoRepro.jpg
Actual result: TMP text showing outside of Canvas as seen in the Repro.jpg

Reproducible with: TMP 3.2.0-pre.1 (2021.3.26f1), TMP 3.2.0-pre.4 (2020.3.48f1, 2021.3.26f1, 2022.2.21f1, 2023.1.0b18)
Not reproducible with: TMP 3.0.6 (2021.3.26f1), UGUI 2.0.0 (2023.2.0a16)
Could not test with: TMP 4.0.0-pre.2 (2022.2.21f1, 2023.1.0b18), UGUI 3.0.0-exp.1 (2023.2.0a16) (NullReferenceException: Object reference not set to an instance of an object)

Reproducible on: Windows 10 Enterprise 21H2

Note:
- Forum post featuring this issue [https://forum.unity.com/threads/tmp-3-2-0-pre-4-incorrectly-calculating-line-height-when-using-size-tag.1427199/|https://forum.unity.com/threads/tmp-3-2-0-pre-4-incorrectly-calculating-line-height-when-using-size-tag.1427199/]

  1. Resolution Note:

    Fixed by another internal issue: TMPB-165: [TextMeshPro] Truncate mode cuts off text when using Content Size Fitter

  2. Resolution Note (fix version 3.2.x):

    Ensure PreferredHeight handles various line heights correctly.

    Sorry for the confusion, the ticket was mistakenly closed as won't fix instead of resolved. The issue will be fixed in com.unity.textmeshpro@3.2.0-pre.5.

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.