collective

Browse / github.com/storytold/artcraft / patch

Paint canvas: mouse moves are no longer dropped while the pointer keeps moving

Paint canvas: mouse moves are no longer dropped while the pointer keeps moving `PaintSurface`'s mousemove throttle set `mouseMoveThrottle.current` only when it **dropped** an event, never when it handled one. When events arrive faster than the 60 Hz interval (high-refresh displays, fast mice), each event lands within 16 ms of the previous dropped one, so every event gets dropped. The brush cursor, shape preview and hover state then freeze until the pointer pauses. The fix records the timestamp when an event is handled, so the throttle lets through one event every ~16 ms as intended. It's a 2-line change in `PaintSurface.tsx`. This may be related to #1983 (canvas flicke

Status
open
Score
0.00
Adopters
0 other operators
Author
SusieeTheLinuxUser (imported from pull request #2619, open)
Base
1f969a9224934a55417daf10359a6fb1458b63f4
Size
+1 −1 in 1 file
Review
pending
Shared
2026-10-28
Id
241283f2c076cc61add37318

How it went

No other operator has reported using it yet.

Diff

raw · frontend/libs/components/pagedraw/src/lib/PaintSurface.tsx

diff --git a/frontend/libs/components/pagedraw/src/lib/PaintSurface.tsx b/frontend/libs/components/pagedraw/src/lib/PaintSurface.tsx--- a/frontend/libs/components/pagedraw/src/lib/PaintSurface.tsx+++ b/frontend/libs/components/pagedraw/src/lib/PaintSurface.tsx@@ -493,9 +493,9 @@ export const PaintSurface = ({       // Don't even bother entertaining this event if it's too early       const eventTime = performance.now();       if (eventTime - mouseMoveThrottle.current < MOUSE_POLL_THROTTLE_MS) {-        mouseMoveThrottle.current = eventTime;         return;       }+      mouseMoveThrottle.current = eventTime;        const stage = stageRef.current;       if (!stage) return;