From 95fdef1986b058fa8c45e8e4215834929bd0c204 Mon Sep 17 00:00:00 2001 From: kron Date: Sat, 21 Jun 2025 22:28:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 4 ++-- src/pages/image-share.vue | 2 +- src/util.js | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/App.vue b/src/App.vue index d0c4558..8f625b3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -140,8 +140,8 @@ button::after { } .share-canvas { - width: 302px; - height: 534px; + width: 300px; + height: 530px; position: absolute; top: -1000px; left: 0; diff --git a/src/pages/image-share.vue b/src/pages/image-share.vue index 186bbc7..d43334a 100644 --- a/src/pages/image-share.vue +++ b/src/pages/image-share.vue @@ -43,7 +43,7 @@ const saveImage = () => { diff --git a/src/util.js b/src/util.js index b636332..4235f97 100644 --- a/src/util.js +++ b/src/util.js @@ -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);