diff --git a/src/canvas.js b/src/canvas.js index ab5b89a..469e240 100644 --- a/src/canvas.js +++ b/src/canvas.js @@ -423,7 +423,7 @@ export const generateShareImage = async (canvasId, data) => { drawLine(ctx, 15, ringBarHeight - 15, 362, ringBarHeight - 15, "#333"); const qrcodeSrc = await loadImage( - "https://static.shelingxingqiu.com/attachment/2025-11-13/de7fzgghsfgqu0ytu6.png" + "https://static.shelingxingqiu.com/attachment/2025-12-04/dep4rqoc0svyrzcakv.jpg" ); const qrcodeImg = await loadCanvasImage(canvas, qrcodeSrc); ctx.drawImage(qrcodeImg, 40, hasPoint ? 715 : 358, 68, 68); diff --git a/src/components/BowTargetEdit.vue b/src/components/BowTargetEdit.vue index 598c18f..ba99c1e 100644 --- a/src/components/BowTargetEdit.vue +++ b/src/components/BowTargetEdit.vue @@ -51,7 +51,6 @@ const onClick = async (e) => { const clickYInContainer = e.detail.y - rect.value.top; let target = clickYInContainer * scale.value - viewportH / 2; target = Math.max(0, Math.min(contentH - viewportH, target)); - console.log(target); setTimeout(() => { scrollTop.value = target > 180 ? target + 10 : target; }, 200); @@ -66,7 +65,8 @@ const onClick = async (e) => { props.id, newArrow.x / scale.value - rect.value.width * 0.05, newArrow.y / scale.value - rect.value.width * 0.05, - rect.value.width * 0.9 + rect.value.width * 0.9, + (10 * scale.value) / 2 ); arrow.value = { ...newArrow, @@ -130,7 +130,8 @@ const onDrag = async (e) => { props.id, arrow.value.x / scale.value - rect.value.width * 0.05, arrow.value.y / scale.value - rect.value.width * 0.05, - rect.value.width * 0.9 + rect.value.width * 0.9, + (10 * scale.value) / 2 ); arrow.value.x = arrow.value.x / side; @@ -212,7 +213,11 @@ onMounted(async () => { :x="arrow ? rect.width * arrow.x : 0" :y="arrow ? rect.width * arrow.y : 0" > - + + {{ arrow.ring === 0 ? "M" : arrow.ring }} diff --git a/src/util.js b/src/util.js index 63bc352..141debe 100644 --- a/src/util.js +++ b/src/util.js @@ -472,7 +472,7 @@ const calcHalfBowTarget = (x, y, diameter, arrowRadius, noX = false) => { if (relativeDistance <= 0.4) return 9; if (relativeDistance <= 0.6) return 8; if (relativeDistance <= 0.8) return 7; - if (relativeDistance <= 0.992) return 6; + if (relativeDistance <= 1) return 6; return 0; // 脱靶 }; @@ -484,60 +484,58 @@ export const calcTripleBowTarget = ( arrowRadius, noX = false ) => { - const side = diameter * 0.324; - if (x / diameter >= 0.316) { - if (y / diameter >= 0.654) { - return calcHalfBowTarget( - x - diameter * 0.342, - y - diameter * 0.68, - side, - arrowRadius, - noX - ); - } - if (y / diameter >= 0.313) { - return calcHalfBowTarget( - x - diameter * 0.342, - y - diameter * 0.34, - side, - arrowRadius, - noX - ); - } - if (y / diameter >= -0.023) { - return calcHalfBowTarget( - x - diameter * 0.342, - y - diameter * 0.005, - side, - arrowRadius, - noX - ); - } + const side = diameter * 0.31; + if (y / diameter >= 0.649) { + return calcHalfBowTarget( + x - diameter * 0.355, + y - diameter * 0.693, + side, + arrowRadius, + noX + ); + } + if (y / diameter >= 0.31) { + return calcHalfBowTarget( + x - diameter * 0.355, + y - diameter * 0.356, + side, + arrowRadius, + noX + ); + } + if (y / diameter >= -0.025) { + return calcHalfBowTarget( + x - diameter * 0.355, + y - diameter * 0.018, + side, + arrowRadius, + noX + ); } return 0; }; export const calcPinBowTarget = (x, y, diameter, arrowRadius, noX = false) => { - const side = diameter * 0.484; + const side = diameter * 0.482; let r1 = 0; let r2 = 0; let r3 = 0; if (x / diameter >= 0.23 && y / diameter >= 0.005) { r1 = calcHalfBowTarget( x - diameter * 0.26, - y - diameter * 0.0345, + y - diameter * 0.034, side, arrowRadius, noX ); } if (x / diameter >= -0.03 && y / diameter >= 0.456) { - r2 = calcHalfBowTarget(x, y - diameter * 0.486, side, arrowRadius, noX); + r2 = calcHalfBowTarget(x, y - diameter * 0.484, side, arrowRadius, noX); } if (x / diameter >= 0.49 && y / diameter >= 0.456) { r3 = calcHalfBowTarget( x - diameter * 0.52, - y - diameter * 0.49, + y - diameter * 0.485, side, arrowRadius, noX @@ -546,11 +544,11 @@ export const calcPinBowTarget = (x, y, diameter, arrowRadius, noX = false) => { return r1 || r2 || r3; }; -export const calcRing = (bowtargetId, x, y, diameter, arrowRadius = 5) => { +export const calcRing = (bowtargetId, x, y, diameter, arrowRadius) => { if (bowtargetId < 4) { return calcNormalBowTarget(x, y, diameter, arrowRadius); } else if (bowtargetId < 7) { - return calcHalfBowTarget(x, y, diameter + 2, arrowRadius); + return calcHalfBowTarget(x, y, diameter, arrowRadius); } else if (bowtargetId === 7) { return calcTripleBowTarget(x, y, diameter, arrowRadius); } else if (bowtargetId === 8) {