Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
bumbu committed Aug 7, 2014
1 parent a9eb0f7 commit ad6e514
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "svg-pan-zoom",
"version": "2.3.1",
"version": "2.3.2",
"homepage": "https://github.com/ariutta/svg-pan-zoom",
"authors": [
"Andrea Leofreddi <a.leofreddi@itcharm.com>",
Expand Down
17 changes: 17 additions & 0 deletions dist/svg-pan-zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,22 @@ var Mousewheel = require('./mousewheel') // Keep it here so that mousewheel is
return {x: this._pan.x, y: this._pan.y}
}

/**
* Recalculates cached svg dimensions and controls position
*/
SvgPanZoom.prototype.resize = function() {
// Get dimensions
var dimensions = SvgUtils.getSvgDimensions(this.svg)
this.width = dimensions.width
this.height = dimensions.height

// Reposition control icons by re-enabling them
if (this.options.controlIconsEnabled) {
this.getPublicInstance().disableControlIcons()
this.getPublicInstance().enableControlIcons()
}
}

/**
* Returns a public instance object
* @return {object} Public instance object
Expand Down Expand Up @@ -807,6 +823,7 @@ var Mousewheel = require('./mousewheel') // Keep it here so that mousewheel is
, getZoom: function() {return that.getZoom()}
, fit: function(dropCache) {return that.fit(dropCache)}
, center: function(dropCache) {return that.center(dropCache)}
, resize: function() {that.resize()}
}
}

Expand Down
Loading

0 comments on commit ad6e514

Please sign in to comment.