From 10c0a63b3d734a224bb2d172508e35e7717e7448 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 14 Nov 2012 14:39:59 +0200 Subject: [PATCH] fixed non-rounded panBy, closes #1085 --- CHANGELOG.md | 1 + src/map/anim/Map.PanAnimation.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f94e1fc..af68b2c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ An in-progress version being developed on the master branch. * Fixed a bug where shift-clicking on a map would zoom it to the max zoom level. * Fixed a glitch with zooming in while panning animation is running. * Fixed a glitch with dragging the map while zoom animation is running. + * Fixed a bug where `panBy` wouldn't round the offset values (so it was possible to make the map blurry with it). [#1085](https://github.com/CloudMade/Leaflet/issues/1085) #### API bugfixes diff --git a/src/map/anim/Map.PanAnimation.js b/src/map/anim/Map.PanAnimation.js index a0e519a3..f18ba04f 100644 --- a/src/map/anim/Map.PanAnimation.js +++ b/src/map/anim/Map.PanAnimation.js @@ -49,7 +49,7 @@ L.Map.include({ L.DomUtil.addClass(this._mapPane, 'leaflet-pan-anim'); - var newPos = L.DomUtil.getPosition(this._mapPane).subtract(offset); + var newPos = L.DomUtil.getPosition(this._mapPane).subtract(offset)._round(); this._panAnim.run(this._mapPane, newPos, duration || 0.25, easeLinearity); return this;