From 486877b323bb829f4ba9ee609c1f1faf0dc43f2f Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 31 Jan 2026 22:02:59 +0800 Subject: [PATCH] fix: reduce zoom step to 5% for finer image scaling control Co-authored-by: Cursor --- components/image-annotator.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/image-annotator.tsx b/components/image-annotator.tsx index cd382d3..0529e65 100644 --- a/components/image-annotator.tsx +++ b/components/image-annotator.tsx @@ -809,23 +809,23 @@ export function ImageAnnotator({ imageUrl, onConfirm, onCancel, initialResizeMod setDragStart(null); }; - // 尺寸调整:放大图片 + // 尺寸调整:放大图片(每次5%) const handleResizeZoomIn = () => { if (!isResizeMode) return; - setResizeImageScale((prev) => Math.min(prev * 1.2, 5)); // 最大5倍 + setResizeImageScale((prev) => Math.min(prev * 1.05, 5)); // 最大5倍,每次放大5% }; - // 尺寸调整:缩小图片 + // 尺寸调整:缩小图片(每次5%) const handleResizeZoomOut = () => { if (!isResizeMode) return; - setResizeImageScale((prev) => Math.max(prev / 1.2, 0.1)); // 最小0.1倍 + setResizeImageScale((prev) => Math.max(prev / 1.05, 0.1)); // 最小0.1倍,每次缩小5% }; - // 尺寸调整:处理图片缩放(鼠标滚轮) + // 尺寸调整:处理图片缩放(鼠标滚轮,每次5%) const handleResizeImageWheel = (e: React.WheelEvent) => { if (!isResizeMode || !image) return; e.preventDefault(); - const delta = e.deltaY > 0 ? -0.1 : 0.1; + const delta = e.deltaY > 0 ? -0.05 : 0.05; // 滚轮每次5% const newScale = Math.max(0.1, Math.min(5, resizeImageScale + delta)); setResizeImageScale(newScale); };