loleaflet/src/layer/SplitPanesContext.js | 16 +++++++++++----- loleaflet/src/layer/tile/CalcTileLayer.js | 7 ++++--- 2 files changed, 15 insertions(+), 8 deletions(-)
New commits: commit ea6cba1c55110dee7b98fe94b5172c269fcecb20 Author: Dennis Francis <dennis.fran...@collabora.com> AuthorDate: Mon Jul 13 14:23:19 2020 +0530 Commit: Dennis Francis <dennis.fran...@collabora.com> CommitDate: Mon Jul 13 12:13:58 2020 +0200 redraw splitter lines on sheet-switch Change-Id: I94f08c6bc3cf6784c374282112463b3c00ba8607 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98622 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Dennis Francis <dennis.fran...@collabora.com> diff --git a/loleaflet/src/layer/SplitPanesContext.js b/loleaflet/src/layer/SplitPanesContext.js index 45dd502e0..ed38d817d 100644 --- a/loleaflet/src/layer/SplitPanesContext.js +++ b/loleaflet/src/layer/SplitPanesContext.js @@ -44,10 +44,10 @@ L.SplitPanesContext = L.Class.extend({ return this._docLayer.getSnapDocPosY(rawMax); }, - setSplitPos: function (splitX, splitY) { + setSplitPos: function (splitX, splitY, forceUpdate) { - this.setHorizSplitPos(splitX); - this.setVertSplitPos(splitY); + this.setHorizSplitPos(splitX, forceUpdate); + this.setVertSplitPos(splitY, forceUpdate); }, alignSplitPos: function () { @@ -81,11 +81,14 @@ L.SplitPanesContext = L.Class.extend({ this._docLayer.getSnapDocPosY(split); }, - setHorizSplitPos: function (splitX) { + setHorizSplitPos: function (splitX, forceUpdate) { console.assert(typeof splitX === 'number', 'splitX must be a number'); if (this._splitPos.x === splitX) { + if (forceUpdate) { + this._updateXSplitter(); + } return; } @@ -95,11 +98,14 @@ L.SplitPanesContext = L.Class.extend({ this._map.fire('splitposchanged'); }, - setVertSplitPos: function (splitY) { + setVertSplitPos: function (splitY, forceUpdate) { console.assert(typeof splitY === 'number', 'splitY must be a number'); if (this._splitPos.y === splitY) { + if (forceUpdate) { + this._updateYSplitter(); + } return; } diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index 36d8d43af..b9ba2674c 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -742,12 +742,12 @@ L.CalcTileLayer = (L.Browser.mobile ? L.TileLayer : L.CanvasTileLayer).extend({ this._map.fire('sheetgeometrychanged'); }, - _updateSplitPos: function () { + _updateSplitPos: function (force) { if (this._splitPanesContext) { if (this._splitPanesContext._splitCell) { var splitCell = this._splitPanesContext._splitCell; var newSplitPos = this.sheetGeometry.getCellRect(splitCell.x, splitCell.y).min; - this._splitPanesContext.setSplitPos(newSplitPos.x, newSplitPos.y); // will update the splitters. + this._splitPanesContext.setSplitPos(newSplitPos.x, newSplitPos.y, force); // will update the splitters. } else { // Can happen only on load. @@ -787,7 +787,8 @@ L.CalcTileLayer = (L.Browser.mobile ? L.TileLayer : L.CanvasTileLayer).extend({ this._splitPanesContext = spContext; if (this.sheetGeometry) { - this._updateSplitPos(); + // Force update of the splitter lines. + this._updateSplitPos(true); } }, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits