Search Issue Tracker
By Design
Votes
0
Found in
2018.2.0a6
Issue ID
1097072
Regression
No
Event.mousePosition returns incorrect value while using HiDPI scaling
Steps to reproduce:
1. Set Windows scaling to a value higher than 100%
2. Open attached "positionTest.zip" Unity project
3. Open "test" scene
4. In Window->Level Editor window enable the checkbox
5. Click on the "Plane" object in Scene view
Expected results: Event.mousePosition returns correct value and a cube is placed on the position of the click
Actual results: Event.mousePosition returns an unscaled value, cube is placed with an offset from the click position
Reproducible with: 2019.1.0a8, 2018.3.0b8, 2017.2.15f1, 2017.2.0a6
Not reproducible with: 2018.2.0a5 (no HiDPI support before 2017.2.0a6)
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
- [Mobile] Developer Console does not appear when an error is thrown
- [HDRP] Game view renders artifacts when Camera's Component "Post Anti-aliasing" is set to "TAA" and Dynamic Resolution's "Forced Screen Percentage" is changed
- A deactivated Prefab's name color becomes white when a GameObject in the scene is deactivated
- The Game view becomes blank when using Frame Debugger with MSAA and Texture binding enabled in Play Mode
- NullReferenceException is thrown when changing the Inspector preview selection
Resolution Note:
Works as designed. MousePosition usage of point units vs the Camera's pixels coordinates is a confusing par of the API. The user script happened to work properly on windows with versions 18.1 and before since EditorGUIUtility.pixelsPerPoints was always 1. Script showed the same issue on 2017.4 on mac with retina displays where EditorGUIUtility.pixelsPerPoints is 2.