Search Issue Tracker
By Design
Votes
0
Found in
2021.3.21f1
2022.2.10f1
2023.1.0b7
2023.2.0a5
Issue ID
UUM-30369
Regression
No
Rectangle drawn with UI Toolkit and mouse input is misaligned when using specific screens
Reproduction steps:
1. Open the attached project "IN-30247_selection"
2. Open "SampleScene"
3. Enter Play mode
4. Click and drag in the top left of the Game view
Expected result: the green (IMGUI) and red (UI Toolkit) rectangles are aligned
Actual result: the red rectangle is misaligned from the green rectangle and the mouse
Reproducible with: 2021.3.21f1, 2022.2.10f1, 2023.1.0b7, 2023.2.0a5
Reproducible on: macOS 12.4 (Intel) 15,4-inch (2880x1800), Windows Surface Studio (2400x1600)
Not reproducible on: Windows 11 (2400x1600, scale 150%)
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
- “Error in Shader Graph Assets/Samples/Shader Graph/17.1.0/Production Ready Shaders/Lit/URPLit.shadergraph: Graph is generating too many variants…” error is thrown after importing Shader Graph Samples
- ComputeShader cannot access the depth element of RenderTexture targeted by an HDR camera
- Search in the Console window highlights wrong text when text contains HTML attributes
- Particle System doesn't always play when ParticleSystem.Play() is called
- Build Profiles: The vertical and horizontal window lines are different colors and this is not consistent with the other engine windows
Resolution Note:
The user did not consider UIToolkit automatic scaling in his code. In the panelSetting, setting the Scale Mode to Constant Pixel Size with a size of 1 make both rectangle perfectly aligned at every screen DPI.
The User could also consider converting the coordinates using the methods in RuntimePanelUtils, like RuntimePanelUtils.ScreenToPanel