[Libreoffice-commits] online.git: loleaflet/src
Dennis Francis (via logerrit)
logerrit at kemper.freedesktop.org
Sun Jul 5 08:02:05 UTC 2020
loleaflet/src/control/Control.Scroll.js | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
New commits:
commit 7f3c250cdf3d6f9a865cded710c507c7a5490e4c
Author: Dennis Francis <dennis.francis at collabora.com>
AuthorDate: Sat May 16 11:14:17 2020 +0530
Commit: Dennis Francis <dennis.francis at 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 <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Dennis Francis <dennis.francis at 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});
}
More information about the Libreoffice-commits
mailing list