[Libreoffice-commits] online.git: loleaflet/src

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Mar 26 14:03:55 UTC 2019


 loleaflet/src/layer/tile/TileLayer.js |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit a0797a751849ac93ea3703f3303132be619747c2
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Sat Mar 23 14:51:27 2019 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Mar 26 15:03:37 2019 +0100

    Make all pages accessible after zooming
    
    After zooming scrollbar was updated and scroll
    position was incorrect what caused first pages
    not accessible.
    
    Regression was introduced by:
    ffd7151443ee360c7764aaa77f9e7fe5f5d64eee
    
    Second problem was jumping to the cursor
    during zooming. Solution was to not update
    the cursors on zooming start.
    
    Change-Id: I0891799b03ed4eccb211ee43eb30e546317a90fc
    Reviewed-on: https://gerrit.libreoffice.org/69606
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>
    (cherry picked from commit f496c1e9c588b382fbdb10ae90a0cd85390274e8)
    Reviewed-on: https://gerrit.libreoffice.org/69748

diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 3ca9336f0..726cb622b 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1588,14 +1588,12 @@ L.TileLayer = L.GridLayer.extend({
 
 	_onZoomStart: function () {
 		this._isZooming = true;
-		this._onUpdateCursor();
-		this.updateAllViewCursors();
 	},
 
 
 	_onZoomEnd: function () {
 		this._isZooming = false;
-		this._onUpdateCursor();
+		this._onUpdateCursor(null, true);
 		this.updateAllViewCursors();
 	},
 
@@ -1619,16 +1617,16 @@ L.TileLayer = L.GridLayer.extend({
 	},
 
 	// Update cursor layer (blinking cursor).
-	_onUpdateCursor: function (scroll) {
+	_onUpdateCursor: function (scroll, zoom) {
 		var cursorPos = this._visibleCursor.getNorthWest();
 		var docLayer = this._map._docLayer;
 
-		if ((scroll !== false) && !this._map.getBounds().contains(this._visibleCursor) && this._isCursorVisible) {
+		if ((!zoom && scroll !== false) && !this._map.getBounds().contains(this._visibleCursor) && this._isCursorVisible) {
 			var center = this._map.project(cursorPos);
 			center = center.subtract(this._map.getSize().divideBy(2));
 			center.x = Math.round(center.x < 0 ? 0 : center.x);
 			center.y = Math.round(center.y < 0 ? 0 : center.y);
-			if (!(this._selectionHandles.start && this._selectionHandles.start.isDragged) &&
+			if (!zoom && !(this._selectionHandles.start && this._selectionHandles.start.isDragged) &&
 			    !(this._selectionHandles.end && this._selectionHandles.end.isDragged) &&
 			    !(docLayer._followEditor || docLayer._followUser)) {
 				this._map.fire('scrollto', {x: center.x, y: center.y, calledFromInvalidateCursorMsg: scroll !== undefined});


More information about the Libreoffice-commits mailing list