fix: set row flex boundary error when deleting element

npr765
Hufe921 2 years ago
parent 136b1ffa55
commit 2f272dee58

@ -53,17 +53,17 @@ export function backspace(evt: KeyboardEvent, host: CanvasEvent) {
return
}
}
// 清空当前行对齐方式
// 替换当前行对齐方式
const startElement = elementList[startIndex]
if (isCollapsed && startElement.rowFlex && startElement.value === ZERO) {
const rowList = draw.getRowList()
const positionList = position.getPositionList()
const rowNo = positionList[startIndex].rowNo
const rowFlexElementList = rowList[rowNo].elementList
const rowFlexElementList = rangeManager.getRangeRowElementList()
if (rowFlexElementList) {
const preElement = elementList[startIndex - 1]
rowFlexElementList.forEach(element => {
delete element.rowFlex
element.rowFlex = preElement?.rowFlex
})
}
}
if (!isCollapsed) {
draw.spliceElementList(elementList, startIndex + 1, endIndex - startIndex)
} else {

Loading…
Cancel
Save