Search Issue Tracker
By Design
Votes
0
Found in
2021.2
2021.2.0a20
2022.1
Issue ID
1342681
Regression
No
Canvas Element does not translate with percentages when size of the element is set to 0
How to reproduce:
1. Open the attached project "Interface.zip"
2. Open Assets/Scenes/Test.unity
3. In the Hierarchy window select "Interface" (Test>Interface Canvas>Interface)
4. In the Inspector window change the value of "Translate X" to "1000"
Expected result: Canvas Element "Interface" moves right in the Game window by 1000%
Actual result: Canvas Element "Interface" does not move
Reproducible with: 2021.2.0b2, 2022.1.0a1
Could not test with: 2018.4.36f1, 2019.4.28f1, 2020.3.13f1, 2021.1.14f1 (compilation errors)
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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Resolution Note:
Contrary to other properties like top, margins, etc. Percentage values, when used with translation, refer to the percentage of the element's size.
We decided to follow the css standard on this instead of deviating from it, the css translate property and function follow the same logic
:
https://developer.mozilla.org/en-US/docs/Web/CSS/translate
https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/translate()