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