From 1e044a40aa9e0b8e2313d4677755c630cb444448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= Date: Tue, 27 Aug 2019 23:44:14 +0900 Subject: [PATCH] suppress mouseout even when dragging a graphic selection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes the problem when a mouseout event interrupts dragging of a graphic selection. Not sure if it is the most correct thing to do, but we can't set "pointer-events" to none on the graphic selection as this then wouldn't recognise that we want to move it around. Change-Id: I42a4785fec0b674d47cd4d7c2977877607b03db8 Reviewed-on: https://gerrit.libreoffice.org/78200 Reviewed-by: Tomaž Vajngerl Tested-by: Tomaž Vajngerl --- loleaflet/src/layer/tile/TileLayer.js | 3 ++- loleaflet/src/layer/vector/SVGGroup.js | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index bbd91a889..95b489b84 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -2373,7 +2373,8 @@ L.TileLayer = L.GridLayer.extend({ transform: true, stroke: false, fillOpacity: 0, - fill: true + fill: true, + ignoreMouseOut: true }); if (!this._graphicMarker) { diff --git a/loleaflet/src/layer/vector/SVGGroup.js b/loleaflet/src/layer/vector/SVGGroup.js index c0297e080..203d0f63a 100644 --- a/loleaflet/src/layer/vector/SVGGroup.js +++ b/loleaflet/src/layer/vector/SVGGroup.js @@ -7,7 +7,8 @@ L.SVGGroup = L.Layer.extend({ options: { noClip: true, - manualDrag: false + manualDrag: false, + ignoreMouseOut: false }, initialize: function (bounds, options) { @@ -64,7 +65,8 @@ L.SVGGroup = L.Layer.extend({ if (!this.options.manualDrag) { L.DomEvent.on(this._dragShape, 'mousemove', this._onDrag, this); L.DomEvent.on(this._dragShape, 'mouseup', this._onDragEnd, this); - L.DomEvent.on(this._dragShape, 'mouseout', this._onDragEnd, this); + if (!this.options.ignoreMouseOut) + L.DomEvent.on(this._dragShape, 'mouseout', this._onDragEnd, this); } var data = { @@ -99,7 +101,8 @@ L.SVGGroup = L.Layer.extend({ if (!this.options.manualDrag) { L.DomEvent.off(this._dragShape, 'mousemove', this._onDrag, this); L.DomEvent.off(this._dragShape, 'mouseup', this._onDragEnd, this); - L.DomEvent.off(this._dragShape, 'mouseout', this._onDragEnd, this); + if (!this.options.ignoreMouseOut) + L.DomEvent.off(this._dragShape, 'mouseout', this._onDragEnd, this); } this._moved = false;