fix(editor): support worker renderer zoom (#9943)

This commit is contained in:
Yifeng Wang
2025-02-05 12:16:06 +08:00
committed by GitHub
parent 0553ae72b5
commit 8afc50c730
4 changed files with 22 additions and 11 deletions
@@ -42,10 +42,12 @@ class CanvasWorkerManager {
const { canvas, ctx } = this;
if (!canvas || !ctx) return;
ctx.font = '15px Inter';
const baselineY = getBaseline();
paragraphs.forEach(paragraph => {
const scale = paragraph.scale ?? 1;
const fontSize = 15 * scale;
ctx.font = `${fontSize}px Inter`;
const baselineY = getBaseline() * scale;
paragraph.sentences.forEach(sentence => {
ctx.strokeStyle = 'yellow';
sentence.rects.forEach(textRect => {