fix: set row flex boundary error when deleting element

npr765
Hufe921 2 years ago
parent 136b1ffa55
commit 2f272dee58

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

Loading…
Cancel
Save