From b02165ffe6fa06d1b6d3af87b28773057e00ad9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=9E=E6=B3=95=E6=93=8D=E4=BD=9C?= Date: Thu, 13 Nov 2025 14:37:27 +0800 Subject: [PATCH] fix: inconsistent behaviour of zoom in button and shortcut (#27944) --- web/app/components/workflow/hooks/use-shortcuts.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/app/components/workflow/hooks/use-shortcuts.ts b/web/app/components/workflow/hooks/use-shortcuts.ts index fa9b019011..e8c69ca9b5 100644 --- a/web/app/components/workflow/hooks/use-shortcuts.ts +++ b/web/app/components/workflow/hooks/use-shortcuts.ts @@ -44,17 +44,17 @@ export const useShortcuts = (): void => { fitView, } = useReactFlow() - // Zoom out to a minimum of 0.5 for shortcut + // Zoom out to a minimum of 0.25 for shortcut const constrainedZoomOut = () => { const currentZoom = getZoom() - const newZoom = Math.max(currentZoom - 0.1, 0.5) + const newZoom = Math.max(currentZoom - 0.1, 0.25) zoomTo(newZoom) } - // Zoom in to a maximum of 1 for shortcut + // Zoom in to a maximum of 2 for shortcut const constrainedZoomIn = () => { const currentZoom = getZoom() - const newZoom = Math.min(currentZoom + 0.1, 1) + const newZoom = Math.min(currentZoom + 0.1, 2) zoomTo(newZoom) }