Skip to content

Commit

Permalink
fix: Call zoomChanged event after updating the zoom (#940)
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 authored Jan 14, 2024
1 parent 19403a2 commit 24f78d3
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 24f78d3

Please sign in to comment.