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

trouble on surface pro 7 #23

Closed liangbohk closed 1 year ago

liangbohk commented 1 year ago

Describe the bug

When I draw a path on surface pro with surface pen, last path disappears. However with my finger I draw a path, last path remains, everything is good

Platform

personalizedrefrigerator commented 1 year ago

Additional information that would be helpful

Are you also experiencing this in the web version of js-draw? (I don't have access to a Windows laptop with a stylus, so can't test this in Joplin directly.)

Edit 1: If it is happening in the browser version, it would be very helpful if you could attach an input event log. This page will generate one. If it doesn't happen in the browser, I can release a version of the plugin with an option to generate an input event log.

Edit 2: Does this also happen with the eraser and selection tools?

What I think the issue is

Here's what I think is causing this: On some browsers, pen up events might also send, in addition to pointerup events, other events (e.g. touchend, or pointerdown events, I'm not sure which). As such, a potential fix is to ignore pointercancel and touch-related events at the end of a stylus-triggered stroke.

personalizedrefrigerator commented 1 year ago

I've published a new version (1.12.1) of the Joplin plugin that might fix the issue for strokes (it should be available in 30 or so minutes).

If it does fix the issue, is there still a similar issue with the eraser, text, and selection tools?

If it does not fix the issue, are you experiencing the issue on the web version (please test with Google Chrome, Microsoft Edge, or another Chromium-based browser)? (If so, an input log would be helpful).

liangbohk commented 1 year ago

it does fix the issue. eraser, text and selection are OK. thanks! attached is screen shot and log when drawing with stylus js-draw js-draw.log

personalizedrefrigerator commented 1 year ago

Thank you for testing this! If you have any other feedback, feel free to post here or open another GitHub issue about it!

Notes: