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
- URP Realtime reflection probes do not update when RenderProbe() is being called once per second
- Addressable terrain shader variants are stripped from the Player
- [iOS] Debug.Log() appears as <private> in Console app
- UI stays in the background when it is disabled in simulator
- A wrong log file is attached when project is launched with a "-logFile" command line argument
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.