From a5c70db8ada3120c250297007c2840528d2c5345 Mon Sep 17 00:00:00 2001 From: kron Date: Fri, 5 Dec 2025 15:37:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=94=BE=E5=A4=A71.4?= =?UTF-8?q?=E5=80=8D=E7=9A=84=E4=B8=89=E8=BF=9E=E9=9D=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BowTargetEdit.vue | 24 ++++++++++++------------ src/util.js | 14 +++++++------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/components/BowTargetEdit.vue b/src/components/BowTargetEdit.vue index 5ef4807..f63e7f1 100644 --- a/src/components/BowTargetEdit.vue +++ b/src/components/BowTargetEdit.vue @@ -43,18 +43,18 @@ const onClick = async (e) => { ) { return; } - // if (props.id === 7 || props.id === 9) { - // // 放大并通过滚动将点击位置置于视窗中心 - // scale.value = 1.4; - // const viewportH = rect.value.width; // 容器高度等于宽度(100vw) - // const contentH = scale.value * rect.value.width; // 内容高度 - // const clickYInContainer = e.detail.y - rect.value.top; - // let target = clickYInContainer * scale.value - viewportH / 2; - // target = Math.max(0, Math.min(contentH - viewportH, target)); - // setTimeout(() => { - // scrollTop.value = target > 180 ? target + 10 : target; - // }, 200); - // } + if (props.id === 7 || props.id === 9) { + // 放大并通过滚动将点击位置置于视窗中心 + scale.value = 1.4; + const viewportH = rect.value.width; // 容器高度等于宽度(100vw) + const contentH = scale.value * rect.value.width; // 内容高度 + const clickYInContainer = e.detail.y - rect.value.top; + let target = clickYInContainer * scale.value - viewportH / 2; + target = Math.max(0, Math.min(contentH - viewportH, target)); + setTimeout(() => { + scrollTop.value = target > 180 ? target + 10 : target; + }, 200); + } const newArrow = { x: (e.detail.x - 6) * scale.value, y: (e.detail.y - rect.value.top - capsuleHeight.value - 6) * scale.value, diff --git a/src/util.js b/src/util.js index 679358d..a6c52bd 100644 --- a/src/util.js +++ b/src/util.js @@ -483,19 +483,19 @@ export const calcTripleBowTarget = ( arrowRadius, noX = false ) => { - const side = diameter * 0.327; // 115 / 351 - if (y / diameter >= 0.649) { + const side = diameter * 0.325; + if (y / diameter >= 0.661) { return calcHalfBowTarget( - x - diameter * 0.338, + x - diameter * 0.336, y - diameter * 0.675, side, arrowRadius, noX ); } - if (y / diameter >= 0.31) { + if (y / diameter >= 0.323) { return calcHalfBowTarget( - x - diameter * 0.338, + x - diameter * 0.336, y - diameter * 0.337, side, arrowRadius, @@ -504,8 +504,8 @@ export const calcTripleBowTarget = ( } if (y / diameter >= -0.026) { return calcHalfBowTarget( - x - diameter * 0.338, - y - diameter * 0, + x - diameter * 0.336, + y - diameter * 0.0, side, arrowRadius, noX