Permalink
Browse files

Code tidy up/compaction

  • Loading branch information...
1 parent 525fe84 commit 80810802dcb72a60bf5638c9cf877bac57b68c3e @danzel committed Jun 14, 2012
Showing with 8 additions and 12 deletions.
  1. +8 −12 src/layer/vector/Path.SVG.js
View
20 src/layer/vector/Path.SVG.js
@@ -127,18 +127,14 @@ L.Map.include({
},
_animateSvgZoom: function (opt) {
- var center = opt.center,
- zoom = opt.zoom,
- centerOffset = this._getNewTopLeftPoint(center).subtract(this._getTopLeftPoint());
-
- var scale = Math.pow(2, zoom - this._zoom),
- offset = centerOffset.divideBy(1 - 1 / scale);
-
- var centerPoint = this.containerPointToLayerPoint(this.getSize().divideBy(2)),
- origin = centerPoint.add(offset);
-
- origin = origin.subtract(this.getSize());
- this._pathRoot.style[L.DomUtil.TRANSFORM] = L.DomUtil.getScaleString(scale, origin) + ' ' + this._pathRoot.style[L.DomUtil.TRANSFORM];
+ var centerOffset = this._getNewTopLeftPoint(opt.center).subtract(this._getTopLeftPoint()),
+ 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),
+ pathRootStyle = this._pathRoot.style;
+
+ pathRootStyle[L.DomUtil.TRANSFORM] = L.DomUtil.getScaleString(scale, origin) + ' ' + pathRootStyle[L.DomUtil.TRANSFORM];
},
_updateSvgViewport: function () {

0 comments on commit 8081080

Please sign in to comment.