Skip to content

Commit

Permalink
fix: Call zoomChanged event after updating the zoom
Browse files Browse the repository at this point in the history
The zoomChange method was not being called on the extensions, and this
commit fixes this by calling the runExtensions method after updating the
zoom.
This commit addresses issue #896
  • Loading branch information
Moath-Zaghdad committed Dec 29, 2023
1 parent 19403a2 commit efe7c12
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/editor/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,7 @@ class Editor extends EditorStartup {
* @param {module:svgcanvas.SvgCanvas#event:zoomed} bbox
* @param {boolean} autoCenter
* @listens module:svgcanvas.SvgCanvas#event:zoomed
* @fires module:svgcanvas.SvgCanvas#event:ext_zoomChanged
* @returns {void}
*/
zoomChanged (win, bbox, autoCenter) {
Expand Down Expand Up @@ -865,6 +866,11 @@ class Editor extends EditorStartup {
}

this.zoomDone()

this.svgCanvas.runExtensions(
'zoomChanged',
/** @type {module:svgcanvas.SvgCanvas#event:ext_zoomChanged} */ this.svgCanvas.getZoom()
)
}

/**
Expand Down

0 comments on commit efe7c12

Please sign in to comment.