fix: 对齐前后端 joker 渲染,消除预览与导出不一致
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user