summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2020-03-19 09:51:05 -0400
committerAndras Timar <andras.timar@collabora.com>2020-03-19 16:35:37 +0100
commita6447b9ea29a5cb8fdac0569a58a68b1b63d5dfc (patch)
tree03bbb68da60b768962a60cc1d14183f0f0f5454a
parenta05604385e3929375ca51a836dd2ba8d4d6eaa41 (diff)
loleaflet: check the cell cursor width to scroll
This is an improvement of the commit 569b342c2029876b1c9ef8b54f235138bff9c792, It is better to check the cell cursor width instead of spacing to scroll the view when very large merge cell occurs Change-Id: I049cda34f886738ce9fbd3776113a219c5bd038f Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90640 Tested-by: Andras Timar <andras.timar@collabora.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--loleaflet/src/layer/tile/TileLayer.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index a398ff1bc..61a5b688b 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2864,12 +2864,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 cursorX = Math.abs(this._cellCursor.getEast() - this._cellCursor.getWest());
+ var spacingX = cursorX / 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 (spacingX < mapX && this._cellCursor.getEast() > mapBounds.getEast()) {
+ } else if (cursorX < mapX && this._cellCursor.getEast() > mapBounds.getEast()) {
scrollX = this._cellCursor.getEast() - mapBounds.getEast() + spacingX;
}
if (this._cellCursor.getNorth() > mapBounds.getNorth()) {