UnityAspectRatioController
UnityAspectRatioController copied to clipboard
Flickers with multiple monitors
Thanks for putting together this utility. I haven't solved this yet (it's kind of hard to work on, since it only happens in a built client, iteration time is slow), but I have a laptop at 4k resolution with Display Settings at 200%, and an external monitor at 1080p. When I drag the corners of the window, it renders every other frame during the drag events at the wrong place. One frame will be centered on my monitor, the next is in the right place. After dragging it's in the right place and aspect ratio.
Similarly, if I drag the window to the other monitor, it starts the teleporting/flickering again until I let go and start dragging it again on that monitor. Something stateful going on inside Windows itself, lots of programs have issues going between monitors with scales applied.
A tip: I added an #if UNITY_STANDALONE_WIN just under the class definition and #endif just above the closing curly brace, so it will compile and work on Mac or other platforms without changing the code.
I found that removing the Aero Snap SetResolution in Update stopped the flicker I was experiencing.
@skambaman you're right. now it's really smooth.
In case someone confuse what to comment.