From abb11ad407da9634c917488aab889752cbd008be Mon Sep 17 00:00:00 2001 From: agent Date: Sun, 27 Sep 2026 21:28:10 +0000 Subject: [PATCH] Drop an eraser drag when the pointer is cancelled A pointercancel (system gesture, notification, palm) used to apply the strokes erased so far. Only a real pointerup commits the erase now, the same as ink strokes. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01GaoZtJQZwLXkEgWs8twCia --- src/lib/components/CanvasView.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/components/CanvasView.svelte b/src/lib/components/CanvasView.svelte index c322b27..4db89b1 100644 --- a/src/lib/components/CanvasView.svelte +++ b/src/lib/components/CanvasView.svelte @@ -442,7 +442,8 @@ live = null; if (e.type === 'pointerup') doc.addStroke(g.pageId, g.rec.stroke); } else if (g.kind === 'erase') { - for (const [pageId, ids] of g.hits) doc.setStrokes(pageId, (s) => s.filter((x) => !ids.has(x.id))); + // Like ink, an interrupted (pointercancel) erase is dropped. + if (e.type === 'pointerup') for (const [pageId, ids] of g.hits) doc.setStrokes(pageId, (s) => s.filter((x) => !ids.has(x.id))); erasing = new Set(); } }