细节调整

This commit is contained in:
kron
2025-06-21 22:28:42 +08:00
parent 6250ce248b
commit 95fdef1986
3 changed files with 6 additions and 6 deletions

View File

@@ -135,7 +135,7 @@ export function generateCanvasImage(canvasId, type, user, data) {
var ctx = uni.createCanvasContext(canvasId);
const width = 303;
const height = 535;
ctx.drawImage("../static/share-bg.png", 0, 0, 302, 534);
ctx.drawImage("../static/share-bg.png", 0, 0, 300, 530);
drawRoundImage(ctx, user.avatar, 17, 20, 37, 37, 20);
ctx.drawImage("../static/avatar-frame.png", 12, 15, 47, 47);
renderText(ctx, user.nickName, 14, "#fff", 80, 32, "center");
@@ -153,14 +153,14 @@ export function generateCanvasImage(canvasId, type, user, data) {
} else if (type == 3) {
titleImage = "../static/practise-two-title.png";
}
ctx.drawImage(titleImage, (width - 160) / 2, 160, 160, 40);
ctx.drawImage(titleImage, (width - 160) / 2 - 5, 160, 160, 40);
const subTitleWidth = ctx.measureText(subTitle).width;
renderText(
ctx,
subTitle,
18,
"#fff",
width / 2 - subTitleWidth - (type > 1 ? 15 : 8),
width / 2 - subTitleWidth - (type > 1 ? 15 : 13),
220
);
renderText(ctx, "共", 16, "#fff", 124, 300);