Closed personalizedrefrigerator closed 2 months ago
Visit the preview URL for this PR (updated for commit 3cddbe6):
https://js-draw--pr73-work-fix-stroke-with-tuli6hu4.web.app
(expires Sat, 15 Jun 2024 19:29:08 GMT)
🔥 via Firebase Hosting GitHub Action 🌎
Sign: e560ee6f7bb6b79cb55b42fb4c05e9fd1b5c506e
Summary
This pull request updates
Pen.ts
to finalize strokes only when the pointer that created them is lifted.Previously,
Pen.ts
incorrectly relied onisPrimary
to determine whether a pointerup event should cause a stroke to be added to the image or ignored. This could be problematic — nonprimary pointers can start strokes. Additionally, in the case of #71, the primary pointer was not marked with isPrimary.Testing
An automated test has been added in
Pen.test.ts
. This test should verify that strokes created with a non-primary pen are added to the image.Fixes #71.