Skip to content

Commit 803d65d

Browse files
committedOct 3, 2016
Build and bump
1 parent 9aa8188 commit 803d65d

File tree

4 files changed

+14
-23
lines changed

4 files changed

+14
-23
lines changed
 

‎bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svg-pan-zoom",
3-
"version": "3.2.11",
3+
"version": "3.3.0",
44
"homepage": "https://github.com/ariutta/svg-pan-zoom",
55
"authors": [
66
"Andrea Leofreddi <a.leofreddi@itcharm.com>",

‎dist/svg-pan-zoom.js

+10-19
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// svg-pan-zoom v3.2.11
1+
// svg-pan-zoom v3.3.0
22
// https://github.com/ariutta/svg-pan-zoom
33
(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){
44
var svgPanZoom = require('./svg-pan-zoom.js');
@@ -215,29 +215,20 @@ ShadowViewport.prototype.cacheViewBox = function() {
215215

216216
this.options.svg.removeAttribute('viewBox')
217217
} else {
218-
var bBox = this.viewport.getBBox();
219-
220-
// Cache viewbox sizes
221-
this.viewBox.x = bBox.x;
222-
this.viewBox.y = bBox.y;
223-
this.viewBox.width = bBox.width
224-
this.viewBox.height = bBox.height
218+
this.simpleViewBoxCache()
225219
}
226220
}
227221

228222
/**
229223
* Recalculate viewport sizes and update viewBox cache
230224
*/
231-
ShadowViewport.prototype.recacheViewBox = function() {
232-
var boundingClientRect = this.viewport.getBoundingClientRect()
233-
, viewBoxWidth = boundingClientRect.width / this.getZoom()
234-
, viewBoxHeight = boundingClientRect.height / this.getZoom()
235-
236-
// Cache viewbox
237-
this.viewBox.x = 0
238-
this.viewBox.y = 0
239-
this.viewBox.width = viewBoxWidth
240-
this.viewBox.height = viewBoxHeight
225+
ShadowViewport.prototype.simpleViewBoxCache = function() {
226+
var bBox = this.viewport.getBBox()
227+
228+
this.viewBox.x = bBox.x
229+
this.viewBox.y = bBox.y
230+
this.viewBox.width = bBox.width
231+
this.viewBox.height = bBox.height
241232
}
242233

243234
/**
@@ -1009,7 +1000,7 @@ SvgPanZoom.prototype.center = function() {
10091000
* Use when viewport contents change
10101001
*/
10111002
SvgPanZoom.prototype.updateBBox = function() {
1012-
this.viewport.recacheViewBox()
1003+
this.viewport.simpleViewBoxCache()
10131004
}
10141005

10151006
/**

‎dist/svg-pan-zoom.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svg-pan-zoom",
3-
"version": "3.2.11",
3+
"version": "3.3.0",
44
"main": "dist/svg-pan-zoom.js",
55
"browser": "src/browserify.js",
66
"license": "BSD-2-Clause",

0 commit comments

Comments
 (0)
Please sign in to comment.