[Libreoffice-commits] online.git: loleaflet/src
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Mon Oct 24 04:19:58 UTC 2016
loleaflet/src/layer/tile/TileLayer.js | 5 +++++
1 file changed, 5 insertions(+)
New commits:
commit b26f2f2738c4c60c8b3212f222336d07465744da
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Sun Oct 23 21:14:30 2016 -0400
loleaflet: prevent the zoomlevel from changing on connect/disconnect
When a client connects or disconnects ViewInfo message is sent.
The handler for this updates the number of users via addView
and removeView. Unfortunately when the toolbar control is
updated, it resets the zoomlevel to 100% (the initial value).
This is an ugly hack to change it back to the correct
value, since nothing really visually changes. It certainly
could be improved by only correcting the toolbar.
Change-Id: I37294da2d9d1bc84e8cb3b7f634aadcfd80d6497
Reviewed-on: https://gerrit.libreoffice.org/30218
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index c26dd47..cbea6e6 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -810,6 +810,11 @@ L.TileLayer = L.GridLayer.extend({
this._removeView(parseInt(viewInfoIdx));
}
}
+
+ //FIXME: Ugly hack to prevent the toolbar from reseting the zoomlevel to 100%.
+ var center = this._map.getCenter();
+ this._map.setView(center, this._map._zoom-1, {reset: false, animate: false});
+ this._map.setView(center, this._map._zoom+1, {reset: true, animate: false});
},
_onPartPageRectanglesMsg: function (textMsg) {
More information about the Libreoffice-commits
mailing list