fix:cannot cut whole line except the first page

pr675
Hufe921 3 years ago
parent f8165eef20
commit ca13a3b268

@ -19,12 +19,14 @@ export function cut(host: CanvasEvent) {
if (startIndex === endIndex) { if (startIndex === endIndex) {
const position = draw.getPosition() const position = draw.getPosition()
const positionList = position.getPositionList() const positionList = position.getPositionList()
const curRowNo = positionList[startIndex].rowNo const startPosition = positionList[startIndex]
const curRowNo = startPosition.rowNo
const curPageNo = startPosition.pageNo
const cutElementIndexList: number[] = [] const cutElementIndexList: number[] = []
for (let p = 0; p < positionList.length; p++) { for (let p = 0; p < positionList.length; p++) {
const position = positionList[p] const position = positionList[p]
if (position.rowNo > curRowNo) break if (position.pageNo > curPageNo) break
if (position.rowNo === curRowNo) { if (position.pageNo === curPageNo && position.rowNo === curRowNo) {
cutElementIndexList.push(p) cutElementIndexList.push(p)
} }
} }

Loading…
Cancel
Save