Search Issue Tracker
By Design
Votes
0
Found in
2020.3.37f1
2021.3.6f1
2022.1.10f1
2022.2.0b1
2023.1.0a3
Issue ID
UUM-9211
Regression
No
VisualElements are scaled inconsistently when using "Scale With Screen Size" and the rendered resolution is not a multiple of "Reference Resolution"
Reproduction steps:
1. Open the attached “UIScaling“ project
2. Open the “SampleScene” scene
3. In the Game window, select the “WXGA (1366x768)” aspect
4. Observe the 6 rectangles in the center of the Game view
Expected result: All rectangles are equal squares
Actual result: Some rectangles are wider than the others (e.g. 2nd and 5th)
Reproduced with: 1.0.0-preview.18 (2020.3.37f1), 2021.3.6f1, 2022.1.10f1, 2022.2.0b1, 2023.1.0a3
Reproduced on: Windows 10/11
Note: Also reproduced in builds
Comments (1)
-
ChristianTeister
Aug 01, 2022 09:00
How is one supposed to create scalables UI where elements don't have a random size offset then?
There is no reference resolution that scales without issues:
If the reference is 1280x720, then it looks messed up on 1920x1080, 2560x1600, 1600x900 1440x900, 1366x768, ...
If the reference is 1920x1080, then it looks messed up on 2560x1440, 3440x1440, 2560x1600, 1366x768, 1280x720This is a horrible design decision.
Using "constant pixel size mode" also doesn't change the pixel grid snapping, so it doesn't help at all.
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
- Editor crash on "PPtr<Shader>::operator Shader*() const" when checking in changes with a very long comment in Unity Version Control window
- [Ubuntu] Toolbar and menu items for Version Control lack spaces in text on Linux
- Unity Version Control window Pending Changes tab’s Item checkbox is unresponsive when clicked and the item list is empty
- Audio stuttering occurs when heavy processing is performed while OnAudioFilterRead is in use
- Inconsistent Node search results in VFX Graph
Resolution Note:
UIToolkit layout engine will always align element boundaries to the pixel grid in order to avoid antialiasing artifacts on edges.
When combined with non-integer scaling factors this can happen. If that behavior is not compatible with your needs, you can use the constant pixel size mode and assign an integer scaling factor to the PanelSettings object.
See https://docs.unity3d.com/2021.2/Documentation/ScriptReference/UIElements.PanelSettings-scale.html