feat:增强渲染性能

This commit is contained in:
黄云飞
2021-11-24 20:27:55 +08:00
parent 742359edf3
commit d4b14c07aa
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -165,6 +165,7 @@ export class Draw {
const { margins, defaultRowMargin, defaultBasicRowMarginHeight } = this.options const { margins, defaultRowMargin, defaultBasicRowMarginHeight } = this.options
const leftTopPoint: [number, number] = [margins[3], margins[0]] const leftTopPoint: [number, number] = [margins[3], margins[0]]
const rightTopPoint: [number, number] = [width - margins[1], margins[0]] const rightTopPoint: [number, number] = [width - margins[1], margins[0]]
const innerWidth = rightTopPoint[0] - leftTopPoint[0]
const rowList: IRow[] = [] const rowList: IRow[] = []
if (this.elementList.length) { if (this.elementList.length) {
rowList.push({ rowList.push({
@@ -186,7 +187,6 @@ export class Draw {
boundingBoxAscent: 0, boundingBoxAscent: 0,
boundingBoxDescent: 0 boundingBoxDescent: 0
} }
const innerWidth = rightTopPoint[0] - leftTopPoint[0]
if (element.type === ElementType.IMAGE) { if (element.type === ElementType.IMAGE) {
metrics.height = element.height! metrics.height = element.height!
// 图片超出尺寸后自适应 // 图片超出尺寸后自适应
+1
View File
@@ -205,6 +205,7 @@ window.onload = function () {
width: image.width, width: image.width,
height: image.height, height: image.height,
}) })
imageFileDom.value = ''
} }
} }
} }