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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
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.