fix:optimize selection operation
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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}`), ''))
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user