细节修改

This commit is contained in:
kron
2025-11-17 15:49:53 +08:00
parent 77f0460dd3
commit 115f270ed1
3 changed files with 11 additions and 17 deletions

View File

@@ -85,7 +85,7 @@ const drawRoundImage = async (
}
};
function drawRingCircle(ctx, x, y, text, diameter = 12) {
function drawRingCircle(ctx, x, y, text, diameter = 9) {
const fillColor = "#ff4444";
const borderColor = "#ffffff";
const borderWidth = 1;
@@ -114,7 +114,7 @@ function drawRingCircle(ctx, x, y, text, diameter = 12) {
ctx.strokeStyle = borderColor;
ctx.stroke();
const fontSize = 9;
const fontSize = 7;
ctx.save();
ctx.translate(cx, cy);
ctx.textAlign = "center";
@@ -328,7 +328,7 @@ export const generateShareImage = async (canvasId, data) => {
renderText(ctx, arrowData.tenRings, 15, "#000", 262, 133);
renderText(ctx, "平均环数", 13, "#999", 25, 175);
renderText(ctx, "总数", 13, "#999", 145, 175);
renderText(ctx, "总数", 13, "#999", 145, 175);
renderText(
ctx,
Number(arrowData.averageRing.toFixed(2)),
@@ -356,8 +356,8 @@ export const generateShareImage = async (canvasId, data) => {
arrowData.list
.filter((arrow) => arrow?.x && arrow?.y)
.forEach((arrow, index) => {
const px = 375 * 0.08 + 375 * 0.84 * arrow.x;
const py = 250 + 375 * 0.84 * arrow.y;
const px = 375 * 0.08 + (375 * 0.84 + 20) * arrow.x;
const py = 250 + (375 * 0.84 + 20) * arrow.y;
drawRingCircle(ctx, px, py, index + 1);
});
}