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

Pranam Lashkari (via logerrit) logerrit at kemper.freedesktop.org
Mon Apr 6 09:09:03 UTC 2020


 loleaflet/src/layer/tile/TileLayer.js |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit aba812fc9f9df12bcf5acc2b8199160a92247624
Author:     Pranam Lashkari <lpranam at collabora.com>
AuthorDate: Mon Apr 6 04:58:12 2020 +0530
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Apr 6 11:08:43 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
    
    Change-Id: I4046cf6728f7da32a4f6d89768e201982023afa9
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91734
    Tested-by: Andras Timar <andras.timar at collabora.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..163957670 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 === 'text') {
+
 			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