commit 76c0f3795bc7464d24a9e95a5d108452d093a095
parent 1475918895ff528f1d3286518a5b9cb3cd99ed02
Author: Sergey Orlov <wladimirych@gmail.com>
Date: Sat, 9 May 2020 10:55:19 +0200
panoramas: round container size
this should fix shivering effect observed at some browser window sizes.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/lib/leaflet.control.panoramas/index.js b/src/lib/leaflet.control.panoramas/index.js
@@ -401,6 +401,7 @@ L.Control.Panoramas = L.Control.extend({
},
setContainerSizePixels: function(size) {
+ size = Math.round(size);
this._panoramasContainer.style[this._splitVerically ? 'width' : 'height'] = `${size}px`;
setTimeout(() => { // map size has not updated yet
const mapSize = this._map._container[this._splitVerically ? 'offsetWidth' : 'offsetHeight'];
@@ -414,7 +415,7 @@ L.Control.Panoramas = L.Control.extend({
const container = this._panoramasContainer;
const containerSize = container[this._splitVerically ? 'offsetWidth' : 'offsetHeight'];
const mapSize = this._map._container[this._splitVerically ? 'offsetWidth' : 'offsetHeight'];
- const newSize = fraction * (mapSize + containerSize);
+ const newSize = Math.round(fraction * (mapSize + containerSize));
container.style[this._splitVerically ? 'width' : 'height'] = `${newSize}px`;
},