From d848a23688d7e406918d3456f4b5b09a5686187d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E4=BA=91=E9=A3=9E?= Date: Fri, 19 Nov 2021 16:25:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=94=BB=E5=B8=83=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E8=87=AA=E9=80=82=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/editor/core/draw/Draw.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/editor/core/draw/Draw.ts b/src/editor/core/draw/Draw.ts index 9f2f0ab..14df5a1 100644 --- a/src/editor/core/draw/Draw.ts +++ b/src/editor/core/draw/Draw.ts @@ -285,8 +285,8 @@ export class Draw { // canvas高度自适应计算 const lastPosition = positionList[positionList.length - 1] const { coordinate: { leftBottom, leftTop } } = lastPosition - if (leftBottom[1] > this.canvas.height) { - const height = Math.ceil(leftBottom[1] + (leftBottom[1] - leftTop[1])) + if (leftBottom[1] > this.canvas.height - margins[2]) { + const height = Math.ceil(leftBottom[1] + (leftBottom[1] - leftTop[1]) + margins[2]) this.canvas.height = height this.canvas.style.height = `${height}px` this.render({ curIndex, isSubmitHistory: false })