细节完善

This commit is contained in:
kron
2025-11-17 16:28:57 +08:00
parent 0a08955caa
commit e50532e2de
2 changed files with 5 additions and 3 deletions

View File

@@ -263,8 +263,8 @@ export const generateShareImage = async (canvasId, data) => {
await drawRoundImage(ctx, avatarImg, 13, 13, 54, 54, 27, "#000", 1);
renderText(ctx, data.user.name, 18, "#000", 84, 36);
renderText(ctx, data.recordDate, 9, "#fff", 350, 24, "center", 39);
renderText(ctx, "今日打卡", 13, "#fff", 336, 38, "center", 39);
renderText(ctx, data.recordDate, 9, "#fff", 348, 23, "center", 39);
renderText(ctx, "今日打卡", 14, "#fff", 336, 38, "center", 39);
// 文本标签
let cursorX = 84;
@@ -437,7 +437,9 @@ export const generateShareImage = async (canvasId, data) => {
120,
hasPoint ? 756 : 402
);
renderText(ctx, "扫码打卡", 13, "#FFA118", 120, hasPoint ? 777 : 422);
renderText(ctx, "扫码打卡", 13, "#FFA118", 142, hasPoint ? 777 : 422);
const pointImg = await loadCanvasImage(canvas, "../static/point.png");
ctx.drawImage(pointImg, 120, hasPoint ? 765 : 410, 18, 14);
// 2D 即时绘制,无需 ctx.draw()
} catch (e) {
console.error("generateShareImage 绘制失败:", e);

BIN
src/static/point.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 B