diff --git a/packages/editor-ui/src/components/canvas/Canvas.vue b/packages/editor-ui/src/components/canvas/Canvas.vue index 460b764548728..866bc644f7e32 100644 --- a/packages/editor-ui/src/components/canvas/Canvas.vue +++ b/packages/editor-ui/src/components/canvas/Canvas.vue @@ -470,7 +470,7 @@ watch(() => props.readOnly, setReadonly, { :position="controlsPosition" :show-interactive="false" :zoom="zoom" - @fit-view="onFitView" + @zoom-to-fit="onFitView" @zoom-in="onZoomIn" @zoom-out="onZoomOut" @reset-zoom="onResetZoom" diff --git a/packages/editor-ui/src/components/canvas/elements/buttons/CanvasControlButtons.vue b/packages/editor-ui/src/components/canvas/elements/buttons/CanvasControlButtons.vue index bb749c9645121..99fe8ec30680b 100644 --- a/packages/editor-ui/src/components/canvas/elements/buttons/CanvasControlButtons.vue +++ b/packages/editor-ui/src/components/canvas/elements/buttons/CanvasControlButtons.vue @@ -14,6 +14,9 @@ const props = withDefaults( const emit = defineEmits<{ 'reset-zoom': []; + 'zoom-in': []; + 'zoom-out': []; + 'zoom-to-fit': []; }>(); const isResetZoomVisible = computed(() => props.zoom !== 1); @@ -21,6 +24,18 @@ const isResetZoomVisible = computed(() => props.zoom !== 1); function onResetZoom() { emit('reset-zoom'); } + +function onZoomIn() { + emit('zoom-in'); +} + +function onZoomOut() { + emit('zoom-out'); +} + +function onZoomToFit() { + emit('zoom-to-fit'); +}