fix:table cursor position in page header

pr675
Hufe921 3 years ago
parent 7b4b33b5c5
commit 85a2bbea60

@ -1318,7 +1318,7 @@ export class Draw {
const positionContext = this.position.getPositionContext()
if (positionContext.isTable) {
const { index, trIndex, tdIndex } = positionContext
const elementList = this.getElementList()
const elementList = this.getOriginalElementList()
const tablePositionList = elementList[index!].trList?.[trIndex!].tdList[tdIndex!].positionList
if (curIndex === undefined && tablePositionList) {
curIndex = tablePositionList.length - 1

@ -11,8 +11,8 @@ function dblclick(host: CanvasEvent, evt: MouseEvent) {
y: evt.offsetY
})
if (!~positionContext.index && positionContext.zone) {
const zoneManager = draw.getZone()
zoneManager.setZone(positionContext.zone)
draw.getZone().setZone(positionContext.zone)
draw.getRange().clearRange()
draw.render({
isSubmitHistory: false,
isSetCursor: false,

@ -35,16 +35,14 @@ export class Position {
}
public getPositionList(): IElementPosition[] {
const elementList = this.draw.getElementList()
return this.positionContext.isTable
? this.getTablePositionList(elementList)
? this.getTablePositionList(this.draw.getOriginalElementList())
: this.getOriginalPositionList()
}
public getMainPositionList(): IElementPosition[] {
const elementList = this.draw.getMainElementList()
return this.positionContext.isTable
? this.getTablePositionList(elementList)
? this.getTablePositionList(this.draw.getOriginalMainElementList())
: this.positionList
}

@ -34,6 +34,10 @@ export class RangeManager {
return this.range
}
public clearRange() {
this.setRange(-1, -1)
}
public getSelection(): IElement[] | null {
const { startIndex, endIndex } = this.range
if (startIndex === endIndex) return null

Loading…
Cancel
Save