personalizedrefrigerator / js-draw

Draw pictures using a pen, touchscreen, or mouse! JS-draw is a freehand drawing library for JavaScript and TypeScript.
https://personalizedrefrigerator.github.io/js-draw/typedoc/
MIT License
79 stars 8 forks source link

fix(editor): Selection tool: Work around bug where the primary pointer is reported as non-primary on some devices. (#71) #74

Closed personalizedrefrigerator closed 2 months ago

personalizedrefrigerator commented 2 months ago

Summary

Allows using non-primary pointers to start a selection.

[!NOTE] According to MDN, for pens,

A pointer is considered primary if the pointer represents a mouse device. A pointer representing pen input is considered the primary pen input if its pointerdown event was dispatched when no other active pointers representing pen input existed.

Also see the spec.

As such, the issue described in #71 is likely related to an upstream bug.

Testing

This pull request a regression test and a test that should verify that pinch-zoom continues to cancel creating a selection.

Resolves #71

github-actions[bot] commented 2 months ago

Visit the preview URL for this PR (updated for commit b6d6d93):

https://js-draw--pr74-work-fix-select-with-534bg1qa.web.app

(expires Wed, 19 Jun 2024 04:18:30 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: e560ee6f7bb6b79cb55b42fb4c05e9fd1b5c506e