commit 60f58bf3b3cc9630a86998b1fd6591dac1d1453c
parent d1d83db13f281c741fd8f760f38dcc73bc012190
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date: Mon, 19 Aug 2024 09:35:10 -0700
Alter svg.js zoom event fire timing
I'm sure there are consequences of this I'm not aware of, but this
fixes the editor's zoom event handler. (This was actually suppost
to be commited along with that addition.)
Diffstat:
1 file changed, 25 insertions(+), 0 deletions(-)
diff --git a/lib/github.com/svgdotjs/svg.panzoom.js/patches/zoom-event.diff b/lib/github.com/svgdotjs/svg.panzoom.js/patches/zoom-event.diff
@@ -0,0 +1,25 @@
+diff --git a/src/svg.panzoom.js b/src/svg.panzoom.js
+index cb4d5dc..67daea9 100644
+--- a/src/svg.panzoom.js
++++ b/src/svg.panzoom.js
+@@ -165,16 +165,16 @@ extend(Svg, {
+ lvl = zoomMin
+ }
+
+- if (this.dispatch('zoom', { level: lvl, focus: p }).defaultPrevented) {
+- return this
+- }
+-
+ this.zoom(lvl, p)
+
+ if (margins) {
+ const box = restrictToMargins(this.viewbox())
+ this.viewbox(box)
+ }
++
++ if (this.dispatch('zoom', { level: lvl, box: this.viewbox(), focus: p }).defaultPrevented) {
++ return this
++ }
+ }
+
+ const pinchZoomStart = function (ev) {