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
- [Android] The Player freezes when disabling Bluetooth while connected to the headphones
- Addressable bundles are not retrieved from the cache when a WebGL Player is refreshed
- Sprites are incorrectly occluded by Sprite Physics Shape culling when behind in sorting order
- CPU usage is increased when the Editor is idle with the ProBuilder Package installed
- Unstable lighting when additional light sources are added in Shader Graph nodes
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.