diff --git a/pages/make/index.vue b/pages/make/index.vue index 6554eb5..18d3f45 100644 --- a/pages/make/index.vue +++ b/pages/make/index.vue @@ -1207,13 +1207,16 @@ function drawUserBubble(ctx, options) { // 3️⃣ 绘制文字 const textX = avatarX + avatarSize + padding; - const textY = drawY + padding; + const totalTextHeight = fontSizeName + fontSizeDesc + 4; + const textStartY = drawY + (bubbleHeight - totalTextHeight) / 2; + ctx.fillStyle = textColor; ctx.font = `${fontSizeName}px 'PingFang SC'`; - ctx.fillText(username, textX, textY); + ctx.fillText(username, textX, textStartY); + ctx.font = `${fontSizeDesc}px 'PingFang SC'`; ctx.globalAlpha = 0.6; - ctx.fillText(desc, textX, textY + fontSizeName + 4); + ctx.fillText(desc, textX, textStartY + fontSizeName + 4); ctx.globalAlpha = 1; }