From b70d9f6c1052ed5a86f309032ed818861027b676 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Tue, 15 Sep 2020 11:02:54 +0100 Subject: calc grid: fix this interleaving. When the span starts in the middle of the view don't render backwards. Change-Id: Icc97fef88a65c0ca83167ddb72c03bece9a8e047 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102951 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky --- loleaflet/src/layer/tile/CalcTileLayer.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index 439f0d8cd..ed7ab0d5d 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -1782,8 +1782,10 @@ L.SheetDimension = L.Class.extend({ (spanData.data.sizecore * (spanData.end - spanData.start + 1)); if (spanFirstCorePx < endPix && spanData.data.poscorepx > startPix) { - var firstCorePx = startPix + spanData.data.sizecore - - ((startPix - spanFirstCorePx) % spanData.data.sizecore); + var firstCorePx = Math.max( + spanFirstCorePx, + startPix + spanData.data.sizecore - + ((startPix - spanFirstCorePx) % spanData.data.sizecore)); var lastCorePx = Math.min(endPix, spanData.data.poscorepx); for (var pos = firstCorePx; pos <= lastCorePx; pos += spanData.data.sizecore) { -- cgit v1.2.3