suppress mouseout even when dragging a graphic selection

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 <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
This commit is contained in:
Tomaž Vajngerl 2019-08-27 23:44:14 +09:00 committed by Tomaž Vajngerl
parent ed8707bcfd
commit 1e044a40aa
2 changed files with 8 additions and 4 deletions

View file

@ -2373,7 +2373,8 @@ L.TileLayer = L.GridLayer.extend({
transform: true,
stroke: false,
fillOpacity: 0,
fill: true
fill: true,
ignoreMouseOut: true
});
if (!this._graphicMarker) {

View file

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