dotween icon indicating copy to clipboard operation
dotween copied to clipboard

Path Editor not correctly scaled for HiDPI/scaled monitors

Open lamara opened this issue 6 years ago • 6 comments

I'm using DOTween, on macOS, on a scaled monitor (at 2x scaling, aka retina). The path editor doesn't appear to respect my machine's scaled screen coordinates, so when adding waypoints, the waypoint's coordinates aren't set at the mouse cursor. They're instead divided by two. This effectively pins all coordinates to the top-left quadrant of the scene view, and is quite annoying to work with.

Attached GIF below to illustrate.

Screen Recording 2020-05-25 at 5 24 40 PM

Versions are: DOTween v1.2.335 DOTweenPro v1.0.178

lamara avatar May 25 '20 21:05 lamara

Ouch, that is very bad :| I will investigate tomorrow but it seems an internal Unity bug. What version of Unity are you on? EDIT: Made the gif bigger and saw it, 2019.3.14. Will investigate on that one.

Demigiant avatar May 26 '20 00:05 Demigiant

Thanks for the quick response!

I'm on Unity 2019.3.14f1.

lamara avatar May 26 '20 00:05 lamara

So the problem is indeed Unity's, which returns the wrong pixel coordinates for the mouse position in the editor (divided by two as you mentioned in case of 200% scaling, meaning it returns the mousePosition as if the UI wasn't scaled at all :|). I'm trying to find a workaround for that :P

Demigiant avatar May 26 '20 10:05 Demigiant

Ok I managed (had to hack into Unity because apparently there is no public way to find the UI Scaling, sigh). Can you write me from here and mention it's you, so I can send you an update? I will need confirmation from you that it works, since I'm not 100% sure the system I found to get the UI scaling is the same for Windows and OSX (because you have no UI Scaling option in the preferences).

Demigiant avatar May 26 '20 11:05 Demigiant

Tested Daniele's patch, and everything looks good on the macOS side. Thanks!

lamara avatar May 26 '20 17:05 lamara

Great ^_^ Will push it on the Asset Store on the next update :)

Demigiant avatar May 27 '20 01:05 Demigiant