From a0797a751849ac93ea3703f3303132be619747c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20K=C5=82os?= Date: Sat, 23 Mar 2019 14:51:27 +0100 Subject: [PATCH] Make all pages accessible after zooming MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Tested-by: Szymon Kłos (cherry picked from commit f496c1e9c588b382fbdb10ae90a0cd85390274e8) Reviewed-on: https://gerrit.libreoffice.org/69748 --- loleaflet/src/layer/tile/TileLayer.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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});