|
1 |
| -// svg-pan-zoom v3.2.11 |
| 1 | +// svg-pan-zoom v3.3.0 |
2 | 2 | // https://github.com/ariutta/svg-pan-zoom
|
3 | 3 | (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){
|
4 | 4 | var svgPanZoom = require('./svg-pan-zoom.js');
|
@@ -215,29 +215,20 @@ ShadowViewport.prototype.cacheViewBox = function() {
|
215 | 215 |
|
216 | 216 | this.options.svg.removeAttribute('viewBox')
|
217 | 217 | } 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() |
225 | 219 | }
|
226 | 220 | }
|
227 | 221 |
|
228 | 222 | /**
|
229 | 223 | * Recalculate viewport sizes and update viewBox cache
|
230 | 224 | */
|
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 |
241 | 232 | }
|
242 | 233 |
|
243 | 234 | /**
|
@@ -1009,7 +1000,7 @@ SvgPanZoom.prototype.center = function() {
|
1009 | 1000 | * Use when viewport contents change
|
1010 | 1001 | */
|
1011 | 1002 | SvgPanZoom.prototype.updateBBox = function() {
|
1012 |
| - this.viewport.recacheViewBox() |
| 1003 | + this.viewport.simpleViewBoxCache() |
1013 | 1004 | }
|
1014 | 1005 |
|
1015 | 1006 | /**
|
|
0 commit comments