Merge pull request #137 from Hufe921/feature/performance
fix:paper remove error in lazy render mode
This commit is contained in:
@@ -1171,14 +1171,7 @@ export class Draw {
|
|||||||
this._createPage(i)
|
this._createPage(i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 绘制元素
|
|
||||||
if (isLazy) {
|
|
||||||
this._lazyRender()
|
|
||||||
} else {
|
|
||||||
this._immediateRender()
|
|
||||||
}
|
|
||||||
// 移除多余页
|
// 移除多余页
|
||||||
nextTick(() => {
|
|
||||||
const curPageCount = this.pageRowList.length
|
const curPageCount = this.pageRowList.length
|
||||||
const prePageCount = this.pageList.length
|
const prePageCount = this.pageList.length
|
||||||
if (prePageCount > curPageCount) {
|
if (prePageCount > curPageCount) {
|
||||||
@@ -1187,7 +1180,12 @@ export class Draw {
|
|||||||
this.pageList.splice(curPageCount, deleteCount)
|
this.pageList.splice(curPageCount, deleteCount)
|
||||||
.forEach(page => page.remove())
|
.forEach(page => page.remove())
|
||||||
}
|
}
|
||||||
})
|
// 绘制元素
|
||||||
|
if (isLazy) {
|
||||||
|
this._lazyRender()
|
||||||
|
} else {
|
||||||
|
this._immediateRender()
|
||||||
|
}
|
||||||
// 光标重绘
|
// 光标重绘
|
||||||
if (isSetCursor) {
|
if (isSetCursor) {
|
||||||
const positionContext = this.position.getPositionContext()
|
const positionContext = this.position.getPositionContext()
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ export class Position {
|
|||||||
positionList.push(positionItem)
|
positionList.push(positionItem)
|
||||||
index++
|
index++
|
||||||
x += metrics.width
|
x += metrics.width
|
||||||
// 绘制表格内元素
|
// 计算表格内元素位置
|
||||||
if (element.type === ElementType.TABLE) {
|
if (element.type === ElementType.TABLE) {
|
||||||
const tdGap = tdPadding * 2
|
const tdGap = tdPadding * 2
|
||||||
for (let t = 0; t < element.trList!.length; t++) {
|
for (let t = 0; t < element.trList!.length; t++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user