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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GaoZtJQZwLXkEgWs8twCia
This commit is contained in:
parent
d2c6e617bb
commit
abb11ad407
1 changed files with 2 additions and 1 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue