From ca13a3b268791e18d7bc6b0b3297ef0ca5c76387 Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Wed, 28 Dec 2022 16:30:23 +0800 Subject: [PATCH] fix:cannot cut whole line except the first page --- src/editor/core/event/handlers/cut.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/editor/core/event/handlers/cut.ts b/src/editor/core/event/handlers/cut.ts index 602b322..61c5a4e 100644 --- a/src/editor/core/event/handlers/cut.ts +++ b/src/editor/core/event/handlers/cut.ts @@ -19,12 +19,14 @@ export function cut(host: CanvasEvent) { if (startIndex === endIndex) { const position = draw.getPosition() const positionList = position.getPositionList() - const curRowNo = positionList[startIndex].rowNo + const startPosition = positionList[startIndex] + const curRowNo = startPosition.rowNo + const curPageNo = startPosition.pageNo const cutElementIndexList: number[] = [] for (let p = 0; p < positionList.length; p++) { const position = positionList[p] - if (position.rowNo > curRowNo) break - if (position.rowNo === curRowNo) { + if (position.pageNo > curPageNo) break + if (position.pageNo === curPageNo && position.rowNo === curRowNo) { cutElementIndexList.push(p) } }