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 = '' } } }