fix: copy style after title line break #531
This commit is contained in:
@@ -37,15 +37,15 @@ export function enter(evt: KeyboardEvent, host: CanvasEvent) {
|
|||||||
if (evt.shiftKey && startElement.listId) {
|
if (evt.shiftKey && startElement.listId) {
|
||||||
enterText.listWrap = true
|
enterText.listWrap = true
|
||||||
}
|
}
|
||||||
// 标题结尾处回车无需格式化
|
// 标题结尾处回车无需格式化及样式复制
|
||||||
if (
|
if (
|
||||||
!(
|
!(
|
||||||
endElement.titleId &&
|
endElement.titleId &&
|
||||||
endElement.titleId !== elementList[endIndex + 1]?.titleId
|
endElement.titleId !== elementList[endIndex + 1]?.titleId
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
// 格式化上下文
|
||||||
formatElementContext(elementList, [enterText], startIndex)
|
formatElementContext(elementList, [enterText], startIndex)
|
||||||
}
|
|
||||||
// 复制样式属性
|
// 复制样式属性
|
||||||
const copyElement = getAnchorElement(elementList, endIndex)
|
const copyElement = getAnchorElement(elementList, endIndex)
|
||||||
if (copyElement) {
|
if (copyElement) {
|
||||||
@@ -57,6 +57,7 @@ export function enter(evt: KeyboardEvent, host: CanvasEvent) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// 控件或文档插入换行元素
|
// 控件或文档插入换行元素
|
||||||
const control = draw.getControl()
|
const control = draw.getControl()
|
||||||
const activeControl = control.getActiveControl()
|
const activeControl = control.getActiveControl()
|
||||||
|
|||||||
Reference in New Issue
Block a user