From dec39151a01dbca5aafa9178d73520a863b70980 Mon Sep 17 00:00:00 2001 From: Thomas Chandelle Date: Wed, 11 Jan 2017 10:21:21 +0100 Subject: [PATCH] Consider pointerdown only if the last pointerup has been emitted --- src/ol/interaction/pointer.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/ol/interaction/pointer.js b/src/ol/interaction/pointer.js index e9c0375afe..048ff27bf9 100644 --- a/src/ol/interaction/pointer.js +++ b/src/ol/interaction/pointer.js @@ -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; };