Skip to content

Commit

Permalink
feat: collapsed selection rect information
Browse files Browse the repository at this point in the history
  • Loading branch information
Hufe921 committed Nov 8, 2023
1 parent 8989831 commit 7c32f95
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/editor/core/command/CommandAdapt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1811,10 +1811,10 @@ export class CommandAdapt {
const endPageNo = positionList[endIndex].pageNo
// 坐标信息(相对编辑器书写区)
const rangeRects: RangeRect[] = []
const height = this.draw.getOriginalHeight()
const pageGap = this.draw.getOriginalPageGap()
const selectionPositionList = this.position.getSelectionPositionList()
if (selectionPositionList) {
const height = this.draw.getOriginalHeight()
const pageGap = this.draw.getOriginalPageGap()
// 起始信息及x坐标
let currentRowNo: number | null = null
let currentX = 0
Expand Down Expand Up @@ -1847,6 +1847,20 @@ export class CommandAdapt {
rangeRects.push(rangeRect)
}
}
} else {
const positionList = this.position.getPositionList()
const position = positionList[endIndex]
const {
coordinate: { rightTop },
pageNo,
lineHeight
} = position
rangeRects.push({
x: rightTop[0],
y: rightTop[1] + pageNo * (height + pageGap),
width: 0,
height: lineHeight
})
}
return deepClone({
isCollapsed,
Expand Down

0 comments on commit 7c32f95

Please sign in to comment.