From d4b14c07aa96c518eb9c65a0b25ef9ee87f91171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E4=BA=91=E9=A3=9E?= Date: Wed, 24 Nov 2021 20:27:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=A2=9E=E5=BC=BA=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/editor/core/draw/Draw.ts | 2 +- src/main.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/editor/core/draw/Draw.ts b/src/editor/core/draw/Draw.ts index a624b6e..f232c85 100644 --- a/src/editor/core/draw/Draw.ts +++ b/src/editor/core/draw/Draw.ts @@ -165,6 +165,7 @@ export class Draw { const { margins, defaultRowMargin, defaultBasicRowMarginHeight } = this.options const leftTopPoint: [number, number] = [margins[3], margins[0]] const rightTopPoint: [number, number] = [width - margins[1], margins[0]] + const innerWidth = rightTopPoint[0] - leftTopPoint[0] const rowList: IRow[] = [] if (this.elementList.length) { rowList.push({ @@ -186,7 +187,6 @@ export class Draw { boundingBoxAscent: 0, boundingBoxDescent: 0 } - const innerWidth = rightTopPoint[0] - leftTopPoint[0] if (element.type === ElementType.IMAGE) { metrics.height = element.height! // 图片超出尺寸后自适应 diff --git a/src/main.ts b/src/main.ts index 7105789..7c99e8d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -205,6 +205,7 @@ window.onload = function () { width: image.width, height: image.height, }) + imageFileDom.value = '' } } }