Skip to content

Commit

Permalink
Code tidy up/compaction
Browse files Browse the repository at this point in the history
  • Loading branch information
danzel committed Jun 14, 2012
1 parent 525fe84 commit 8081080
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/layer/vector/Path.SVG.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -127,18 +127,14 @@ L.Map.include({
}, },


_animateSvgZoom: function (opt) { _animateSvgZoom: function (opt) {
var center = opt.center, var centerOffset = this._getNewTopLeftPoint(opt.center).subtract(this._getTopLeftPoint()),
zoom = opt.zoom, scale = Math.pow(2, opt.zoom - this._zoom),
centerOffset = this._getNewTopLeftPoint(center).subtract(this._getTopLeftPoint()); offset = centerOffset.divideBy(1 - 1 / scale),

centerPoint = this.containerPointToLayerPoint(this.getSize().divideBy(-2)),
var scale = Math.pow(2, zoom - this._zoom), origin = centerPoint.add(offset),
offset = centerOffset.divideBy(1 - 1 / scale); pathRootStyle = this._pathRoot.style;


var centerPoint = this.containerPointToLayerPoint(this.getSize().divideBy(2)), pathRootStyle[L.DomUtil.TRANSFORM] = L.DomUtil.getScaleString(scale, origin) + ' ' + pathRootStyle[L.DomUtil.TRANSFORM];
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];
}, },


_updateSvgViewport: function () { _updateSvgViewport: function () {
Expand Down

0 comments on commit 8081080

Please sign in to comment.