修复放大1.4倍的三连靶
This commit is contained in:
@@ -43,18 +43,18 @@ const onClick = async (e) => {
|
|||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// if (props.id === 7 || props.id === 9) {
|
if (props.id === 7 || props.id === 9) {
|
||||||
// // 放大并通过滚动将点击位置置于视窗中心
|
// 放大并通过滚动将点击位置置于视窗中心
|
||||||
// scale.value = 1.4;
|
scale.value = 1.4;
|
||||||
// const viewportH = rect.value.width; // 容器高度等于宽度(100vw)
|
const viewportH = rect.value.width; // 容器高度等于宽度(100vw)
|
||||||
// const contentH = scale.value * rect.value.width; // 内容高度
|
const contentH = scale.value * rect.value.width; // 内容高度
|
||||||
// const clickYInContainer = e.detail.y - rect.value.top;
|
const clickYInContainer = e.detail.y - rect.value.top;
|
||||||
// let target = clickYInContainer * scale.value - viewportH / 2;
|
let target = clickYInContainer * scale.value - viewportH / 2;
|
||||||
// target = Math.max(0, Math.min(contentH - viewportH, target));
|
target = Math.max(0, Math.min(contentH - viewportH, target));
|
||||||
// setTimeout(() => {
|
setTimeout(() => {
|
||||||
// scrollTop.value = target > 180 ? target + 10 : target;
|
scrollTop.value = target > 180 ? target + 10 : target;
|
||||||
// }, 200);
|
}, 200);
|
||||||
// }
|
}
|
||||||
const newArrow = {
|
const newArrow = {
|
||||||
x: (e.detail.x - 6) * scale.value,
|
x: (e.detail.x - 6) * scale.value,
|
||||||
y: (e.detail.y - rect.value.top - capsuleHeight.value - 6) * scale.value,
|
y: (e.detail.y - rect.value.top - capsuleHeight.value - 6) * scale.value,
|
||||||
|
|||||||
14
src/util.js
14
src/util.js
@@ -483,19 +483,19 @@ export const calcTripleBowTarget = (
|
|||||||
arrowRadius,
|
arrowRadius,
|
||||||
noX = false
|
noX = false
|
||||||
) => {
|
) => {
|
||||||
const side = diameter * 0.327; // 115 / 351
|
const side = diameter * 0.325;
|
||||||
if (y / diameter >= 0.649) {
|
if (y / diameter >= 0.661) {
|
||||||
return calcHalfBowTarget(
|
return calcHalfBowTarget(
|
||||||
x - diameter * 0.338,
|
x - diameter * 0.336,
|
||||||
y - diameter * 0.675,
|
y - diameter * 0.675,
|
||||||
side,
|
side,
|
||||||
arrowRadius,
|
arrowRadius,
|
||||||
noX
|
noX
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (y / diameter >= 0.31) {
|
if (y / diameter >= 0.323) {
|
||||||
return calcHalfBowTarget(
|
return calcHalfBowTarget(
|
||||||
x - diameter * 0.338,
|
x - diameter * 0.336,
|
||||||
y - diameter * 0.337,
|
y - diameter * 0.337,
|
||||||
side,
|
side,
|
||||||
arrowRadius,
|
arrowRadius,
|
||||||
@@ -504,8 +504,8 @@ export const calcTripleBowTarget = (
|
|||||||
}
|
}
|
||||||
if (y / diameter >= -0.026) {
|
if (y / diameter >= -0.026) {
|
||||||
return calcHalfBowTarget(
|
return calcHalfBowTarget(
|
||||||
x - diameter * 0.338,
|
x - diameter * 0.336,
|
||||||
y - diameter * 0,
|
y - diameter * 0.0,
|
||||||
side,
|
side,
|
||||||
arrowRadius,
|
arrowRadius,
|
||||||
noX
|
noX
|
||||||
|
|||||||
Reference in New Issue
Block a user