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
- Terms of Service agreement checkbox is invisible under specific OS system themes (UI Accessibility)
- Tile Palette: "Create New Tilemap" dropdown area is displayed in several colors
- Input.mousePosition stops syncing to touch input when using "DownloadHandlerTexture" in WebGL build
- UI Builder canvas doesn't update element styling accordingly when changing Active Theme for some Editor Authoring elements
- Selector Value buttons are not aligned with parameters in UI Builder
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