Search Issue Tracker

By Design

Votes

0

Found in

2022.3.62f1

6000.0.49f1

6000.1.3f1

6000.2.0b1

Issue ID

UUM-105343

Regression

No

"GetPreferedValue" returns max value when using auto-sizing

-

Reproduction steps:
1. Open the attached “IN-100421” project
2. Open the “Scenes/SampleScene” Scene
3. Enter the Play Mode
4. Select the “Text (TMP)” GameObject in the Hierarchy window
5. Make sure “Auto Size” option is checked under “TextMeshPro - Text” component
6. Press the “Test PrefferedValue” button under “Test Text Mesh” component
7. Observe the “Rect” GameObject’s size

Expected result: “Rect” GameObject’s size is set to text’s preferred value
Actual result: “Rect” GameObject’s size is set to text’s auto sizing max value

Reproducible with: 3.0.9, 3.2.0-pre.12 (2022.3.62f1), 6000.0.49f1, 6000.1.3f1, 6000.1.0b1
Couldn’t test with: 4.0.0-pre.2 (2022.3.62f1) - Compilation errors

Reproducible on: Windows 10
Not reproducible on: No other environment tested

Note:
- “GetRenderedValues” function returns proper size values

  1. Resolution Note:

    This is more of a philosophical question than a bug. When Auto‑Size is on and the text has no layout constraints, we return the maximum font size you set, because that’s the largest size Auto‑Size can choose. If you need GetPreferredSize to use the exact font size you specified, Auto-Size could be disabled.

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.