From 6ff449f405a35e1be54e5df734307bc5d51febf3 Mon Sep 17 00:00:00 2001 From: suixy <2277317060@qq.com> Date: Wed, 22 Oct 2025 16:17:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ruler.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/ruler.vue b/src/components/ruler.vue index aa7b120..3c5e244 100644 --- a/src/components/ruler.vue +++ b/src/components/ruler.vue @@ -97,6 +97,8 @@ watch(() => JSON.stringify(props.boxPos), (newVal, oldVal) => { zoomScale(props.boxPos.y, 2) } getBoxPos() + } else { + zoomScale(props.boxPos.y, 0) } } if (props.dotIndex >= 0) { @@ -121,6 +123,8 @@ watch(() => props.dotIndex, (newVal, oldVal) => { zoomScale(props.boxPos.y, 2) } getBoxPos() + } else { + zoomScale(props.boxPos.y, 0) } } if (props.dotIndex >= 0) { @@ -222,7 +226,7 @@ const leftTicks = computed(() => { return arr } - let factor = zoomType.value === 1 ? 10 : zoomType.value === 2 ? 50 : 1 + let factor = zoomType.value === 1 ? Math.ceil(props.height / 100) : zoomType.value === 2 ? Math.ceil(props.height / 30) : 1 let step = Math.floor(10 / factor) if (step < 1) step = 1