loleaflet/src/control/Control.Scroll.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
New commits: commit 7f3c250cdf3d6f9a865cded710c507c7a5490e4c Author: Dennis Francis <dennis.fran...@collabora.com> AuthorDate: Sat May 16 11:14:17 2020 +0530 Commit: Dennis Francis <dennis.fran...@collabora.com> CommitDate: Sun Jul 5 10:01:43 2020 +0200 Restore the scope of 'offset' tampering code as it was before 317afcecb4 This 'adjustment' was just meant for refreshViewData() or whatever it was called before, to indicate that both column/row headers/gridlines should be updated, no matter what the actual offset is (probably only meant for zoom changes?). The offset passed to refreshViewData is only going to be used as a boolean flag. This patch fixes the row/col headers getting a off-by-one pixel when changing zooms with the new data-source (.uno:SheetGeometryData). If using the older source (.uno:ViewRowColumnHeader), this bug is hidden because of the delay for fetching the JSON everytime before painting the headers. TODO: Refactor all calls of refreshViewData to get rid of the 'offset' and this adjustment code and only send the boolean flags to refreshViewData(). Change-Id: I4c30e8f06a6a2d58b9a9a89e283d7a214d00b99c Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97948 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Dennis Francis <dennis.fran...@collabora.com> diff --git a/loleaflet/src/control/Control.Scroll.js b/loleaflet/src/control/Control.Scroll.js index 36eed31fe..0cde2b4c9 100644 --- a/loleaflet/src/control/Control.Scroll.js +++ b/loleaflet/src/control/Control.Scroll.js @@ -259,15 +259,21 @@ L.Control.Scroll = L.Control.extend({ // used on window resize // also when dragging var offset = new L.Point(e.x - this._prevScrollX, e.y - this._prevScrollY); - if (offset.x === 0) { - offset.x = 1; - } - if (offset.y === 0) { - offset.y = 1; - } this._map.fire('scrolloffset', offset); if (e.updateHeaders && this._map._docLayer._docType === 'spreadsheet') { + // This adjustment was just meant for refreshViewData() + // to indicate that both column/row headers/gridlines + // should be updated, no matter what the actual offset + // is (unsure why). + // TODO: Get rid of the 'offset' adjustment and + // only send boolean flags to refreshViewData(). + if (offset.x === 0) { + offset.x = 1; + } + if (offset.y === 0) { + offset.y = 1; + } this._map._docLayer.refreshViewData({x: e.x, y: e.y, offset: offset}); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits