Search Issue Tracker
By Design
By Design in 2023.2.X
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
- 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:
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
Resolution Note (2023.2.X):
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