Skip to content

Commit

Permalink
Merge pull request #70 from nedredmond/master
Browse files Browse the repository at this point in the history
Use `pointermove` instead of `mousemove` to allow touch interactions to work
  • Loading branch information
Fuzzyma authored Nov 16, 2024
2 parents eb88694 + 9a2330c commit 03204a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit 03204a1

Please sign in to comment.