Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pointermove instead of mousemove to allow touch interactions to work #70

Merged
merged 2 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@svgdotjs/svg.draw.js",
"version": "3.0.1",
"version": "3.0.2",
"description": "An extension for svg.js which allows to draw elements with mouse",
"type": "module",
"keywords": [
Expand Down
6 changes: 3 additions & 3 deletions src/svg.draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class PaintHandler {
this.el.fire('drawstart', { event: event, p: this.p, m: this.m })

// We need to bind the update-function to the mousemove event to keep track of the cursor
on(window, 'mousemove.draw', function (e) {
on(window, 'pointermove.draw', function (e) {
_this.update(e)
})

Expand Down Expand Up @@ -120,7 +120,7 @@ class PaintHandler {
}

// Unbind from all events
off(window, 'mousemove.draw')
off(window, 'pointermove.draw')
this.parent.off('click.draw')

// remove Refernce to PaintHandler
Expand Down Expand Up @@ -222,7 +222,7 @@ class PaintHandler {
}

extend(Element, {
// Draw element with mouse
// Draw element with pointer
draw: function (event, options, value) {
// sort the parameters
if (!(event instanceof Event || typeof event === 'string')) {
Expand Down