[Libreoffice-commits] online.git: loleaflet/src
Pranam Lashkari (via logerrit)
logerrit at kemper.freedesktop.org
Mon Apr 6 19:47:28 UTC 2020
loleaflet/src/layer/tile/TileLayer.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
New commits:
commit 212d707227a11955719ae0a238bc546935ea919c
Author: Pranam Lashkari <lpranam at collabora.com>
AuthorDate: Tue Apr 7 00:38:50 2020 +0530
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Apr 6 21:47:10 2020 +0200
leaflet: stoped view jumping when deselecting shapes/images
cause of the problem: if the last position of the cursor
before selecting a complex object is out of view
then the page will scroll to that point.
This happens because scrolling takes place between
deselecting object and cursor position update
test failing problem with aba812f resolved
Change-Id: I7c1aea4a4a8b83cec9bd166adaa0e099ad16f070
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91781
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 3d3c86bf1..a38f88049 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2140,7 +2140,12 @@ L.TileLayer = L.GridLayer.extend({
var cursorPos = this._visibleCursor.getNorthWest();
var docLayer = this._map._docLayer;
- if (!zoom && scroll !== false && !this._map.getBounds().contains(this._visibleCursor) && this._map._isCursorVisible) {
+ if (!zoom
+ && scroll !== false
+ && !this._map.getBounds().contains(this._visibleCursor)
+ && this._map._isCursorVisible
+ && this._map._clip._selectionType !== 'complex') {
+
var center = this._map.project(cursorPos);
center = center.subtract(this._map.getSize().divideBy(2));
center.x = Math.round(center.x < 0 ? 0 : center.x);
More information about the Libreoffice-commits
mailing list