mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-26 18:56:55 -06:00
With Windows Ink, winit reports a pen as a touch and drops its pen flags, so on Windows the eraser end of a pen draws with the current tool. The message hook that reads the barrel button now also reads each pen pointer message's POINTER_PEN_INFO and writes the pen's pressure and end into the canvas's pen feed: PEN_FLAG_INVERTED or PEN_FLAG_ERASER is the eraser end. The canvas then selects the Eraser tool and the tip brings back the tool used before, as on Linux and macOS. A pen leaving detection range or the window, another pointer, or a mouse message that Windows did not make from a pen or a touch clears the feed, so a mouse presses fully.