[Libreoffice-commits] online.git: loleaflet/src
Mihai Varga
mihai.varga at collabora.com
Thu Aug 20 08:46:04 PDT 2015
loleaflet/src/layer/tile/TileLayer.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 1a31cab91870ccc9e1f98b502d15f3038d5a9f83
Author: Mihai Varga <mihai.varga at collabora.com>
Date: Thu Aug 20 18:45:40 2015 +0300
loleaflet: round scrollTo coordinates
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 010f7b0..0d91645 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -463,8 +463,8 @@ L.TileLayer = L.GridLayer.extend({
if (!this._map.getBounds().contains(selectionCenter)) {
var center = this._map.project(selectionCenter);
center = center.subtract(this._map.getSize().divideBy(2));
- center.x = center.x < 0 ? 0 : center.x;
- center.y = center.y < 0 ? 0 : center.y;
+ center.x = Math.round(center.x < 0 ? 0 : center.x);
+ center.y = Math.round(center.y < 0 ? 0 : center.y);
this._map.fire('scrollto', {x: center.x, y: center.y});
}
@@ -645,8 +645,8 @@ L.TileLayer = L.GridLayer.extend({
if (!e && !this._map.getBounds().contains(cursorPos) && this._isCursorVisible) {
var center = this._map.project(cursorPos);
center = center.subtract(this._map.getSize().divideBy(2));
- center.x = center.x < 0 ? 0 : center.x;
- center.y = center.y < 0 ? 0 : center.y;
+ center.x = Math.round(center.x < 0 ? 0 : center.x);
+ center.y = Math.round(center.y < 0 ? 0 : center.y);
this._map.fire('scrollto', {x: center.x, y: center.y});
}
More information about the Libreoffice-commits
mailing list