[Libreoffice-commits] online.git: loleaflet/src
Dennis Francis (via logerrit)
logerrit at kemper.freedesktop.org
Tue Feb 11 08:45:23 UTC 2020
loleaflet/src/control/Control.ColumnHeader.js | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
New commits:
commit 002691d56c215f1df535f0fe342145f1f9964494
Author: Dennis Francis <dennis.francis at collabora.com>
AuthorDate: Fri Feb 7 13:44:03 2020 +0530
Commit: Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Feb 11 09:45:05 2020 +0100
zoom-adjust header-height only when we have edit permissions
The patch :
-------------------------------------------------
commit ab64d2e0c315d26c358ff99548bb7353708eab6b
Author: Dennis Francis <dennis.francis at collabora.com>
Date: Wed Jan 29 13:38:16 2020 +0530
Adjust column-header height with zoom-level too
--------------------------------------------------
introduced adjusting of column header height with zoom level.
But that messes up the positions of headers in the below scenario:
1. First zoom-in or out in mobile mode before enabling edit permissions
2. Then enable edit permissions, and now the header positions are all
messed up.
This happens because the formulabar ui is show only while in edit-mode
and the resize() method is not very robust(it adjusts 'top' style attribute
with height deltas) and does not consider the introduction of formula-bar
div into account when one changes the permission of the sheet from
'readonly' to 'edit' in mobile mode.
So lets not do resize() of the column-header container before entering
edit mode and avoid complications of adjusting for the introduction of
the formula-bar.
Change-Id: Ib03f89ad7a34cbd2a3cbfb65af2a9a016b47c125
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88175
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
diff --git a/loleaflet/src/control/Control.ColumnHeader.js b/loleaflet/src/control/Control.ColumnHeader.js
index 76c536e17..8c049fd93 100644
--- a/loleaflet/src/control/Control.ColumnHeader.js
+++ b/loleaflet/src/control/Control.ColumnHeader.js
@@ -389,12 +389,14 @@ L.Control.ColumnHeader = L.Control.Header.extend({
this._setCanvasWidth();
this._setCanvasHeight();
this._canvasContext.clearRect(0, 0, canvas.width, canvas.height);
- // Adjust (column) _headerHeight according to zoomlevel. This is used below to call resize()
- // where column/corner header are resized. Besides the document container and row header container
- // are moved up or down as required so that there is no gap/overlap below column header.
- // Limit zoomScale so that the column header is not too small (unreadable) or too big.
- this._headerHeight = Math.ceil(this._canvasBaseHeight *
- this.getHeaderZoomScale(/* lowerBound */ 0.74, /* upperBound */ 1.15));
+ if (this._map._permission === 'edit') {
+ // Adjust (column) _headerHeight according to zoomlevel. This is used below to call resize()
+ // where column/corner header are resized. Besides the document container and row header container
+ // are moved up or down as required so that there is no gap/overlap below column header.
+ // Limit zoomScale so that the column header is not too small (unreadable) or too big.
+ this._headerHeight = Math.ceil(this._canvasBaseHeight *
+ this.getHeaderZoomScale(/* lowerBound */ 0.74, /* upperBound */ 1.15));
+ }
// Reset state
this._current = -1;
More information about the Libreoffice-commits
mailing list