fix: 对齐前后端 joker 渲染,消除预览与导出不一致

This commit is contained in:
Poker Design Developer
2026-06-01 22:23:15 +08:00
parent 35529e3738
commit 10eb05e675
2 changed files with 8 additions and 6 deletions

View File

@@ -318,8 +318,9 @@ async function drawJokerBody(ctx, w, h, which, design, project) {
const pad = Math.max(10, w * 0.04)
// 左上角标
ctx.font = `bold ${labelSize}px ${design.font_family || 'Times New Roman'}, serif`
ctx.font = `${textSize}px ${design.font_family || 'Times New Roman'}, serif`
ctx.fillText('JOKER', pad, pad)
ctx.font = `bold ${labelSize}px ${design.font_family || 'Times New Roman'}, serif`
ctx.fillText(label, pad, pad + textSize + 4)
// 右下角标
@@ -329,8 +330,9 @@ async function drawJokerBody(ctx, w, h, which, design, project) {
ctx.fillStyle = '#FFFFFF'
ctx.textAlign = 'left'
ctx.textBaseline = 'top'
ctx.font = `bold ${labelSize}px ${design.font_family || 'Times New Roman'}, serif`
ctx.font = `${textSize}px ${design.font_family || 'Times New Roman'}, serif`
ctx.fillText('JOKER', 0, 0)
ctx.font = `bold ${labelSize}px ${design.font_family || 'Times New Roman'}, serif`
ctx.fillText(label, 0, textSize + 4)
ctx.restore()