summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2018-10-06 23:17:13 +0100
committerMichael Meeks <michael.meeks@collabora.com>2018-10-06 23:17:13 +0100
commitba4df21b4232e5c21397b5824c64b1b595743c13 (patch)
tree22ab9736ff05b8f23fe85eba5c9aef0417e9ff13
parent1c39bb118c44fcac58073eaad72ca25e797eeb42 (diff)
Hide other view cursors on zoom.private/mmeeks/cursors
Change-Id: I9e953f841b5c526b499f9170aef9b2682011947e
-rw-r--r--loleaflet/src/layer/tile/TileLayer.js15
-rw-r--r--test/data/hello-world.odpbin12256 -> 11423 bytes
-rw-r--r--test/data/hello-world.odsbin8078 -> 8338 bytes
3 files changed, 13 insertions, 2 deletions
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index ac601994b..573b46d76 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1523,12 +1523,14 @@ L.TileLayer = L.GridLayer.extend({
_onZoomStart: function () {
this._isZooming = true;
this._onUpdateCursor();
+ this.updateAllViewCursors();
},
_onZoomEnd: function () {
this._isZooming = false;
this._onUpdateCursor();
+ this.updateAllViewCursors();
},
_updateCursorPos: function () {
@@ -1604,8 +1606,11 @@ L.TileLayer = L.GridLayer.extend({
var viewCursorVisible = this._viewCursors[viewId].visible;
var viewPart = this._viewCursors[viewId].part;
- if (!this._map.isViewReadOnly(viewId) && viewCursorVisible && !this._isEmptyRectangle(this._viewCursors[viewId].bounds) &&
- (this._docType === 'text' || this._selectedPart === viewPart)) {
+ if (!this._map.isViewReadOnly(viewId) &&
+ viewCursorVisible &&
+ !this._isZooming &&
+ !this._isEmptyRectangle(this._viewCursors[viewId].bounds) &&
+ (this._docType === 'text' || this._selectedPart === viewPart)) {
if (!viewCursorMarker) {
var viewCursorOptions = {
color: L.LOUtil.rgbToHex(this._map.getViewColor(viewId)),
@@ -1629,6 +1634,12 @@ L.TileLayer = L.GridLayer.extend({
}
},
+ updateAllViewCursors : function() {
+ for (var key in this._viewCursors) {
+ this._onUpdateViewCursor(key);
+ }
+ },
+
isCursorVisible: function() {
return this._map.hasLayer(this._cursorMarker);
},
diff --git a/test/data/hello-world.odp b/test/data/hello-world.odp
index 9918755ef..774b8e3c9 100644
--- a/test/data/hello-world.odp
+++ b/test/data/hello-world.odp
Binary files differ
diff --git a/test/data/hello-world.ods b/test/data/hello-world.ods
index 37ddf33f1..eccadf96a 100644
--- a/test/data/hello-world.ods
+++ b/test/data/hello-world.ods
Binary files differ