fix:optimize selection operation
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -39,5 +39,5 @@ export function writeTextByElementList(elementList: IElement[]) {
|
||||
}
|
||||
pickTextFromElement(elementList)
|
||||
if (!text) return
|
||||
writeText(text)
|
||||
writeText(text.replace(new RegExp(`^${ZERO}`), ''))
|
||||
}
|
||||
Reference in New Issue
Block a user