drag: pass event.multitouch to each touchevent (#292)

This commit is contained in:
jean-emmanuel 2018-05-17 12:26:16 +02:00
parent faa487c7af
commit 908bda5a81
2 changed files with 17 additions and 11 deletions

View file

@ -1,12 +1,17 @@
# Changelog
## 0.30.5
- bug fixes
- regression breaking multitouch widgets
## 0.30.4
- bug fixes
- regression breaking touch traversing gestures
- clone widgets becomming unselectable for edition
- `preArgs` property still being coerced to an array
## 0.30.3
- bug fixes

View file

@ -97,15 +97,15 @@ function pointerUpFilter(event) {
// Mouse events wrappers
function mouseDownCapture(event) {
if ((event.sourceCapabilities && event.sourceCapabilities.firesTouchEvents) || event.button == 2) return
event.pointerId = 'mouse'
pointerDownHandler(event)
function mouseMultiWrapper(event) {
mouseDownCapture(event, true)
}
function mouseMultiWrapper(event) {
event.multitouch = true
mouseDownCapture(event)
function mouseDownCapture(event, multitouch) {
if ((event.sourceCapabilities && event.sourceCapabilities.firesTouchEvents) || event.button == 2) return
event.pointerId = 'mouse'
event.multitouch = multitouch
pointerDownHandler(event)
}
function mouseMoveCapture(event) {
@ -124,11 +124,10 @@ function mouseUpCapture(event){
// Touch events wrappers
function touchMultiWrapper(event) {
event.multitouch = true
touchDownCapture(event)
touchDownCapture(event, true)
}
function touchDownCapture(event) {
function touchDownCapture(event, multitouch) {
event.preventDefault()
for (var i in event.changedTouches) {
if (isNaN(i) || !event.changedTouches[i]) continue
@ -140,6 +139,8 @@ function touchDownCapture(event) {
}
touchEvent.pointerId = touchEvent.identifier
touchEvent.multitouch = multitouch
pointerDownHandler(touchEvent)
}
}