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

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Wed Mar 18 22:08:25 UTC 2020


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

New commits:
commit 569b342c2029876b1c9ef8b54f235138bff9c792
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Tue Mar 17 16:38:01 2020 -0400
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Mar 18 23:08:07 2020 +0100

    loleaflet: do not scroll cell cursor marker if width is very large
    
    When the cursor has a large width due to full merged row cell
    it has an undesired effect that scroll to last columns
    
    Change-Id: Ic939b8d9c3007faa46897893cc462cf3dbbee563
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90671
    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 7cdea620d..a398ff1bc 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2863,12 +2863,13 @@ L.TileLayer = L.GridLayer.extend({
 					}
 				}
 				else if (horizontalDirection !== 0 || verticalDirection != 0) {
+					var mapX = Math.abs(mapBounds.getEast() - mapBounds.getWest());
 					var spacingX = Math.abs(this._cellCursor.getEast() - this._cellCursor.getWest()) / 4.0;
 					var spacingY = Math.abs((this._cellCursor.getSouth() - this._cellCursor.getNorth())) / 4.0;
 
 					if (this._cellCursor.getWest() < mapBounds.getWest()) {
 						scrollX = this._cellCursor.getWest() - mapBounds.getWest() - spacingX;
-					} else if (this._cellCursor.getEast() > mapBounds.getEast()) {
+					} else if (spacingX < mapX && this._cellCursor.getEast() > mapBounds.getEast()) {
 						scrollX = this._cellCursor.getEast() - mapBounds.getEast() + spacingX;
 					}
 					if (this._cellCursor.getNorth() > mapBounds.getNorth()) {


More information about the Libreoffice-commits mailing list