Skip to content

Commit

Permalink
Build and bump
Browse files Browse the repository at this point in the history
  • Loading branch information
bumbu committed Nov 21, 2016
1 parent 57fb063 commit b831a39
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
5 changes: 3 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "svg-pan-zoom",
"version": "3.3.0",
"version": "3.4.0",
"homepage": "https://github.com/ariutta/svg-pan-zoom",
"authors": [
"Andrea Leofreddi <a.leofreddi@itcharm.com>",
Expand All @@ -19,7 +19,8 @@
"Barry Coughlan (https://github.com/bcoughlan)",
"Ionică Bizău (http://ionicabizau.net/)",
"Ciprian Placintă (https://github.com/CiprianPlacinta)",
"Riccardo Santoro (https://github.com/VeNoMiS)"
"Riccardo Santoro (https://github.com/VeNoMiS)",
"César Vidril (https://github.com/Yimiprod)"
],
"description": "JavaScript library for panning and zooming an SVG image from the mouse, touches and programmatically.",
"main": "dist/svg-pan-zoom.js",
Expand Down
18 changes: 14 additions & 4 deletions dist/svg-pan-zoom.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// svg-pan-zoom v3.3.0
// svg-pan-zoom v3.4.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 @@ -181,7 +181,10 @@ ShadowViewport.prototype.init = function(viewport, options) {
this.cacheViewBox()

// Process CTM
this.processCTM()
var newCTM = this.processCTM()

// Update viewport CTM and cache zoom and pan
this.setCTM(newCTM)

// Update CTM in this frame
this.updateCTM()
Expand Down Expand Up @@ -243,6 +246,8 @@ ShadowViewport.prototype.getViewBox = function() {
/**
* Get initial zoom and pan values. Save them into originalState
* Parses viewBox attribute to alter initial sizes
*
* @return {CTM} CTM object based on options
*/
ShadowViewport.prototype.processCTM = function() {
var newCTM = this.getCTM()
Expand Down Expand Up @@ -274,8 +279,7 @@ ShadowViewport.prototype.processCTM = function() {
this.originalState.x = newCTM.e
this.originalState.y = newCTM.f

// Update viewport CTM and cache zoom and pan
this.setCTM(newCTM);
return newCTM
}

/**
Expand Down Expand Up @@ -1047,6 +1051,12 @@ SvgPanZoom.prototype.resize = function() {
this.width = boundingClientRectNormalized.width
this.height = boundingClientRectNormalized.height

// Recalculate original state
var viewport = this.viewport
viewport.options.width = this.width
viewport.options.height = this.height
viewport.processCTM()

// Reposition control icons by re-enabling them
if (this.options.controlIconsEnabled) {
this.getPublicInstance().disableControlIcons()
Expand Down
4 changes: 2 additions & 2 deletions dist/svg-pan-zoom.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "svg-pan-zoom",
"version": "3.3.0",
"version": "3.4.0",
"main": "dist/svg-pan-zoom.js",
"types": "dist/svg-pan-zoom.d.ts",
"browser": "src/browserify.js",
Expand Down
2 changes: 2 additions & 0 deletions src/shadow-viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ ShadowViewport.prototype.getViewBox = function() {
/**
* Get initial zoom and pan values. Save them into originalState
* Parses viewBox attribute to alter initial sizes
*
* @return {CTM} CTM object based on options
*/
ShadowViewport.prototype.processCTM = function() {
var newCTM = this.getCTM()
Expand Down

0 comments on commit b831a39

Please sign in to comment.