antfu / live-draw

A tool allows you to draw on screen real-time.
MIT License
700 stars 111 forks source link

feat: Support multiple monitors #51

Open truemogician opened 1 year ago

truemogician commented 1 year ago

Description

Live-Draw currently only works for the primary monitor. You cannot draw on additional screens. This PR solves this problem. The approach is to set the bounding of the window to cover all monitors at the beginning. To make sure the palette will always be in visible areas, it'll be placed in the center of the primary screen during this process. Additionally, since the screen settings may change, this process will also be executed again when it happens (triggered by Microsoft.Win32.SystemEvents.DisplaySettingsChanged).
I personally have 2 screens, and it works fine on my computer. I suppose it'll also work for more than 2 monitors.