Skip to content

Commit

Permalink
Build and bump
Browse files Browse the repository at this point in the history
  • Loading branch information
bumbu committed Oct 3, 2016
1 parent 9aa8188 commit 803d65d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 23 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": "3.2.11",
"version": "3.3.0",
"homepage": "https://github.com/ariutta/svg-pan-zoom",
"authors": [
"Andrea Leofreddi <a.leofreddi@itcharm.com>",
Expand Down
29 changes: 10 additions & 19 deletions dist/svg-pan-zoom.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// svg-pan-zoom v3.2.11
// svg-pan-zoom v3.3.0
// https://github.com/ariutta/svg-pan-zoom
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var svgPanZoom = require('./svg-pan-zoom.js');
Expand Down Expand Up @@ -215,29 +215,20 @@ ShadowViewport.prototype.cacheViewBox = function() {

this.options.svg.removeAttribute('viewBox')
} else {
var bBox = this.viewport.getBBox();

// Cache viewbox sizes
this.viewBox.x = bBox.x;
this.viewBox.y = bBox.y;
this.viewBox.width = bBox.width
this.viewBox.height = bBox.height
this.simpleViewBoxCache()
}
}

/**
* Recalculate viewport sizes and update viewBox cache
*/
ShadowViewport.prototype.recacheViewBox = function() {
var boundingClientRect = this.viewport.getBoundingClientRect()
, viewBoxWidth = boundingClientRect.width / this.getZoom()
, viewBoxHeight = boundingClientRect.height / this.getZoom()

// Cache viewbox
this.viewBox.x = 0
this.viewBox.y = 0
this.viewBox.width = viewBoxWidth
this.viewBox.height = viewBoxHeight
ShadowViewport.prototype.simpleViewBoxCache = function() {
var bBox = this.viewport.getBBox()

this.viewBox.x = bBox.x
this.viewBox.y = bBox.y
this.viewBox.width = bBox.width
this.viewBox.height = bBox.height
}

/**
Expand Down Expand Up @@ -1009,7 +1000,7 @@ SvgPanZoom.prototype.center = function() {
* Use when viewport contents change
*/
SvgPanZoom.prototype.updateBBox = function() {
this.viewport.recacheViewBox()
this.viewport.simpleViewBoxCache()
}

/**
Expand Down
Loading

0 comments on commit 803d65d

Please sign in to comment.