fix: 大小王角标不显示 & 导出整副牌失效

This commit is contained in:
Poker Design Developer
2026-06-01 22:20:57 +08:00
parent b0cdd8c3ad
commit 35529e3738
3 changed files with 22 additions and 10 deletions

View File

@@ -316,16 +316,25 @@ async function drawJokerBody(ctx, w, h, which, design, project) {
const labelSize = Math.max(20, Math.round(w * 0.06))
const textSize = Math.max(16, Math.round(w * 0.045))
const pad = Math.max(10, w * 0.04)
// 左上角标
ctx.font = `bold ${labelSize}px ${design.font_family || 'Times New Roman'}, serif`
ctx.fillText('JOKER', pad, pad)
ctx.fillText(label, pad, pad + textSize + 4)
// 右下:旋转 180° 平移
// 右下角标
ctx.save()
ctx.translate(w - pad, h - pad)
ctx.rotate(Math.PI)
ctx.fillStyle = '#FFFFFF'
ctx.textAlign = 'left'
ctx.textBaseline = 'top'
ctx.font = `bold ${labelSize}px ${design.font_family || 'Times New Roman'}, serif`
ctx.fillText('JOKER', 0, 0)
ctx.fillText(label, 0, textSize + 4)
ctx.restore()
ctx.restore()
}
async function drawBackSide(ctx, w, h, design, project) {