[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3' - loleaflet/src
Tamás Zolnai
tamas.zolnai at collabora.com
Mon Jun 18 10:53:10 UTC 2018
loleaflet/src/layer/tile/TileLayer.js | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
New commits:
commit 232f50cf9c3c4a3995304d38566956d7f3f321b5
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
Date: Fri Jun 15 17:24:39 2018 +0200
Hide text cursor while performing the zoom
Change-Id: Ic358b2f345ba4e1e1d826b6e2cc96b3cc53269d6
Reviewed-on: https://gerrit.libreoffice.org/55881
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>
(cherry picked from commit 30e4f586ecf8001daeed018c19ad693709bceb43)
Reviewed-on: https://gerrit.libreoffice.org/55882
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
Tested-by: Jan Holesovsky <kendy at collabora.com>
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index ebf953302..711eb2ef9 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -77,6 +77,8 @@ L.TileLayer = L.GridLayer.extend({
this._visibleCursor = new L.LatLngBounds(new L.LatLng(0, 0), new L.LatLng(0, 0));
// Cursor overlay is visible or hidden (for blinking).
this._isCursorOverlayVisible = false;
+ // Cursor overlay visibility flag to store last state during zooming
+ this._oldCursorOverlayVisibility = false;
// Cursor is visible or hidden (e.g. for graphic selection).
this._isCursorVisible = true;
// Original rectangle graphic selection in twips
@@ -243,7 +245,8 @@ L.TileLayer = L.GridLayer.extend({
map.on('dragover', this._onDragOver, this);
map.on('drop', this._onDrop, this);
- map.on('zoomend', this._onUpdateCursor, this);
+ map.on('zoomstart', this._onZoomStart, this);
+ map.on('zoomend', this._onZoomEnd, this);
if (this._docType === 'spreadsheet') {
map.on('zoomend', this._onCellCursorShift, this);
}
@@ -1446,6 +1449,18 @@ L.TileLayer = L.GridLayer.extend({
return bounds.getSouthWest().equals(new L.LatLng(0, 0)) && bounds.getNorthEast().equals(new L.LatLng(0, 0));
},
+ _onZoomStart: function () {
+ this._oldCursorOverlayVisibility = this._isCursorOverlayVisible;
+ this._isCursorOverlayVisible = false;
+ this._onUpdateCursor();
+ },
+
+
+ _onZoomEnd: function () {
+ this._isCursorOverlayVisible = this._oldCursorOverlayVisibility;
+ this._onUpdateCursor();
+ },
+
// Update cursor layer (blinking cursor).
_onUpdateCursor: function (scroll) {
var cursorPos = this._visibleCursor.getNorthWest();
More information about the Libreoffice-commits
mailing list