zoom-event.diff (639B)
1 diff --git a/src/svg.panzoom.js b/src/svg.panzoom.js 2 index cb4d5dc..67daea9 100644 3 --- a/src/svg.panzoom.js 4 +++ b/src/svg.panzoom.js 5 @@ -165,16 +165,16 @@ extend(Svg, { 6 lvl = zoomMin 7 } 8 9 - if (this.dispatch('zoom', { level: lvl, focus: p }).defaultPrevented) { 10 - return this 11 - } 12 - 13 this.zoom(lvl, p) 14 15 if (margins) { 16 const box = restrictToMargins(this.viewbox()) 17 this.viewbox(box) 18 } 19 + 20 + if (this.dispatch('zoom', { level: lvl, box: this.viewbox(), focus: p }).defaultPrevented) { 21 + return this 22 + } 23 } 24 25 const pinchZoomStart = function (ev) {