From 066bd6e9b039498f2962a99cefb30b327708b1ea Mon Sep 17 00:00:00 2001 From: Ned Redmond Date: Fri, 15 Nov 2024 21:32:44 -0500 Subject: [PATCH 1/2] use pointermove to allow touch --- src/svg.draw.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/svg.draw.js b/src/svg.draw.js index 27a777a..356a360 100644 --- a/src/svg.draw.js +++ b/src/svg.draw.js @@ -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) }) @@ -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 @@ -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')) { From 9a2330c843758ab6f312b566a5598503286b00dd Mon Sep 17 00:00:00 2001 From: Ned Redmond Date: Fri, 15 Nov 2024 21:38:50 -0500 Subject: [PATCH 2/2] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bdb6524..40ba243 100644 --- a/package.json +++ b/package.json @@ -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": [