From 973654b2d7501d79a6ed3bf7235cde35e9d9d1f2 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 19 Mar 2025 13:35:52 +0100 Subject: [PATCH] multixy: fix touch state vs feedback filtering order (dragend event handler sorting) --- src/client/widgets/pads/multixy.js | 34 +++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/client/widgets/pads/multixy.js b/src/client/widgets/pads/multixy.js index 3747ec9a..3c1037b1 100644 --- a/src/client/widgets/pads/multixy.js +++ b/src/client/widgets/pads/multixy.js @@ -111,6 +111,23 @@ class MultiXy extends Pad { this.padsCoords = [] this.touchMap = {} + this.on('dragend',(e)=>{ + + var i = this.touchMap[e.pointerId] + + if (!i) return + + e.stopPropagation = true + + this.pads[i].touched = 0 + this.pads[i].trigger('dragend', e) + + this.trigger('touch', {stopPropagation: true, touch: [parseInt(this.touchMap[e.pointerId]), 0]}) + + delete this.touchMap[e.pointerId] + + }, {element: this.widget, multitouch: true}) + touchstate(this, {element: this.widget, multitouch: true}) this.on('draginit',(e)=>{ @@ -148,23 +165,6 @@ class MultiXy extends Pad { }, {element: this.widget, multitouch: true}) - this.on('dragend',(e)=>{ - - var i = this.touchMap[e.pointerId] - - if (!i) return - - e.stopPropagation = true - - this.pads[i].touched = 0 - this.pads[i].trigger('dragend', e) - - this.trigger('touch', {stopPropagation: true, touch: [parseInt(this.touchMap[e.pointerId]), 0]}) - - delete this.touchMap[e.pointerId] - - }, {element: this.widget, multitouch: true}) - this.on('value-changed',(e)=>{ if (e.widget == this) return e.stopPropagation = true