Skip to content
Browse files

rename _zooming inside Path to _pathZooming so it has a different nam…

…e to _zooming in Map.TouchZoom. Minor other tidy ups.
  • Loading branch information...
1 parent 289071f commit 8d605a0f8d55d5e791206cb51d1d3a60f8804099 @danzel committed Jun 19, 2012
Showing with 6 additions and 6 deletions.
  1. +4 −4 src/layer/vector/Path.SVG.js
  2. +1 −1 src/layer/vector/canvas/Path.Canvas.js
  3. +1 −1 src/map/handler/Map.TouchZoom.js
View
8 src/layer/vector/Path.SVG.js
@@ -134,19 +134,19 @@ L.Map.include({
scale = Math.pow(2, opt.zoom - this._zoom),
offset = centerOffset.divideBy(1 - 1 / scale),
centerPoint = this.containerPointToLayerPoint(this.getSize().divideBy(-2)),
- origin = centerPoint.add(offset),
+ origin = centerPoint.add(offset).round(),
pathRootStyle = this._pathRoot.style;
pathRootStyle[L.DomUtil.TRANSFORM] = L.DomUtil.getScaleString(scale, origin) + ' ' + L.DomUtil.getTranslateString(L.DomUtil.getPosition(this._pathRoot));
- this._zooming = true;
+ this._pathZooming = true;
},
_endZoom: function () {
- this._zooming = false;
+ this._pathZooming = false;
},
_updateSvgViewport: function () {
- if (this._zooming) {
+ if (this._pathZooming) {
//Do not update SVGs while a zoom animation is going on otherwise the animation will break.
//When the zoom animation ends we will be updated again anyway
//This fixes the case where you do a momentum move and zoom while the move is still ongoing.
View
2 src/layer/vector/canvas/Path.Canvas.js
@@ -129,7 +129,7 @@ L.Map.include((L.Path.SVG && !window.L_PREFER_CANVAS) || !L.Browser.canvas ? {}
},
_updateCanvasViewport: function () {
- if (this._zooming) {
+ if (this._pathZooming) {
//Don't redraw while zooming. See _updateSvgViewport for more details
return;
}
View
2 src/map/handler/Map.TouchZoom.js
@@ -52,7 +52,7 @@ L.Map.TouchZoom = L.Handler.extend({
if (this._scale === 1) { return; }
- var zoom = this._map._zoom + Math.log(this._scale) / Math.log(2);
+ var zoom = this._map._zoom + Math.log(this._scale) / Math.LN2;
var centerOffset = this._centerOffset.subtract(this._delta).divideBy(this._scale),
centerPoint = this._map.getPixelOrigin().add(this._startCenter).add(centerOffset),

0 comments on commit 8d605a0

Please sign in to comment.
Something went wrong with that request. Please try again.