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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
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.