Consider pointerdown only if the last pointerup has been emitted

This commit is contained in:
Thomas Chandelle
2017-01-11 10:21:21 +01:00
parent bb29102e73
commit dec39151a0

View File

@@ -187,15 +187,17 @@ ol.interaction.Pointer.handleEvent = function(mapBrowserEvent) {
if (mapBrowserEvent.type == ol.MapBrowserEventType.POINTERDRAG) {
this.handleDragEvent_(mapBrowserEvent);
} else if (mapBrowserEvent.type == ol.MapBrowserEventType.POINTERUP) {
this.handlingDownUpSequence = this.handleUpEvent_(mapBrowserEvent);
this.handleUpEvent_(mapBrowserEvent);
this.handlingDownUpSequence = false;
}
} else {
if (mapBrowserEvent.type == ol.MapBrowserEventType.POINTERDOWN) {
var handled = this.handleDownEvent_(mapBrowserEvent);
this.handlingDownUpSequence = handled;
stopEvent = this.shouldStopEvent(handled);
} else if (mapBrowserEvent.type == ol.MapBrowserEventType.POINTERMOVE) {
this.handleMoveEvent_(mapBrowserEvent);
}
}
if (mapBrowserEvent.type == ol.MapBrowserEventType.POINTERDOWN) {
var handled = this.handleDownEvent_(mapBrowserEvent);
this.handlingDownUpSequence = handled;
stopEvent = this.shouldStopEvent(handled);
} else if (mapBrowserEvent.type == ol.MapBrowserEventType.POINTERMOVE) {
this.handleMoveEvent_(mapBrowserEvent);
}
return !stopEvent;
};