Search Issue Tracker
By Design
Votes
2
Found in
2018.4
2019.3.3f1
2020.2
Issue ID
1223878
Regression
No
The values of Width and Height properties in Rect Transform differs when Preferred Size is set in the Content Size Fitter
The values of Width and Height properties in Rect Transform are different in the Scene View and in the Prefab Mode when the Preferred Size is set in the Content Size Fitter component
How to reproduce:
1. Open the project "case_1223878-ContentSizeFitter"
2. Open the Scene "SampleScene"
3. Select the GameObject "Image" in the Hierarchy
4. Observe the values of Width and Height properties in the Rect Transform component in the Inspector
5. Press the Open button in the Inspector to open the Prefab
6. Observe the values of Width and Height properties in the Rect Transform component in the Inspector
Expected results: the values of Width and Height properties in the Rect Transform component are different in the Prefab Mode and in the Scene view
Actual results: the values of Width and Height properties in the Rect Transform component are the same in the Prefab Mode and in the Scene view
Reproducible with: 2018.4.18f1, 2019.3.3f1, 2020.1.0a25, 2020.2.0a1
Could not test with: 2017.4.37f1 because the Prefab Mode is not available
Notes:
1. It is reproducible only when the GameObject "Image" has the Content Size Fitter component where Horizontal Fit and Vertical Fit are set to Preferred Size
2. It is not reproducible when the GameObejct "Canvas" has the Canvas Scaler component where Reference Pixels Per Unit is set to 100
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 (2020.1.9f1):
When opening the prefab mode there is a default canvas element that is created for UI elements. This is created with default values. If the user has changed the defaults on their canvas they can override the default UI scene used for prefab mode. This would be required in this case as they system is doing what its suppose to based on the data it has.