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]
// 是否在头部
if (isHead) {
const headIndex = positionList.findIndex(p => p.rowNo === firstLetterList[j].rowNo)
curPositionIndex = ~headIndex ? headIndex : index
const headIndex = positionList.findIndex(p => p.pageNo === curPageNo && p.rowNo === firstLetterList[j].rowNo)
curPositionIndex = ~headIndex ? headIndex - 1 : index
} else {
curPositionIndex = index
}
+1 -1
View File
@@ -39,5 +39,5 @@ export function writeTextByElementList(elementList: IElement[]) {
}
pickTextFromElement(elementList)
if (!text) return
writeText(text)
writeText(text.replace(new RegExp(`^${ZERO}`), ''))
}