fix:optimize selection operation

This commit is contained in:
黄云飞
2022-03-08 16:52:34 +08:00
parent 9939f8d591
commit f3f19eb9c6
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -148,8 +148,8 @@ export class Position {
const isHead = x < this.options.margins[3] const isHead = x < this.options.margins[3]
// 是否在头部 // 是否在头部
if (isHead) { if (isHead) {
const headIndex = positionList.findIndex(p => p.rowNo === firstLetterList[j].rowNo) const headIndex = positionList.findIndex(p => p.pageNo === curPageNo && p.rowNo === firstLetterList[j].rowNo)
curPositionIndex = ~headIndex ? headIndex : index curPositionIndex = ~headIndex ? headIndex - 1 : index
} else { } else {
curPositionIndex = index curPositionIndex = index
} }
+1 -1
View File
@@ -39,5 +39,5 @@ export function writeTextByElementList(elementList: IElement[]) {
} }
pickTextFromElement(elementList) pickTextFromElement(elementList)
if (!text) return if (!text) return
writeText(text) writeText(text.replace(new RegExp(`^${ZERO}`), ''))
} }