multixy: fix touch state vs feedback filtering order (dragend event handler sorting)

This commit is contained in:
jean-emmanuel 2025-03-19 13:35:52 +01:00
parent c0a331ece6
commit 973654b2d7

View file

@ -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