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
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
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
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.