From 7fa58f8290bd368dc70fc5c568bea7c2b7385bd1 Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Sat, 25 May 2024 18:30:46 +0800 Subject: [PATCH] fix: drawing size error when browser scale page #594 --- src/editor/core/draw/Draw.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/editor/core/draw/Draw.ts b/src/editor/core/draw/Draw.ts index ae2f6b3..38acbef 100644 --- a/src/editor/core/draw/Draw.ts +++ b/src/editor/core/draw/Draw.ts @@ -2131,7 +2131,12 @@ export class Draw { private _clearPage(pageNo: number) { const ctx = this.ctxList[pageNo] const pageDom = this.pageList[pageNo] - ctx.clearRect(0, 0, pageDom.width, pageDom.height) + ctx.clearRect( + 0, + 0, + Math.max(pageDom.width, this.getWidth()), + Math.max(pageDom.height, this.getHeight()) + ) this.blockParticle.clear() }