From e7a42b082b8c39abfa41d91d5220d81261a41de9 Mon Sep 17 00:00:00 2001 From: marvin Date: Tue, 24 Dec 2024 17:59:25 +0800 Subject: [PATCH] fix: zoom in/out click --- .../components/workflow/operator/zoom-in-out.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/web/app/components/workflow/operator/zoom-in-out.tsx b/web/app/components/workflow/operator/zoom-in-out.tsx index 654097b43028b0..54ace49d9ddc96 100644 --- a/web/app/components/workflow/operator/zoom-in-out.tsx +++ b/web/app/components/workflow/operator/zoom-in-out.tsx @@ -130,7 +130,7 @@ const ZoomInOut: FC = () => { crossAxis: -2, }} > - +
{ shortcuts={['ctrl', '-']} >
{ + if (zoom <= 0.25) + return + e.stopPropagation() zoomOut() }} @@ -153,14 +156,17 @@ const ZoomInOut: FC = () => {
-
{parseFloat(`${zoom * 100}`).toFixed(0)}%
+
{parseFloat(`${zoom * 100}`).toFixed(0)}%
= 2 ? 'cursor-not-allowed' : 'cursor-pointer hover:bg-black/5'}`} onClick={(e) => { + if (zoom >= 2) + return + e.stopPropagation() zoomIn() }}