Fix:修复非富文本模式下文本编辑实时渲染功能在一些结构中会出现异常的问题

This commit is contained in:
街角小林 2024-12-06 15:17:59 +08:00
parent 53c2af0bc0
commit efb4dcf236
2 changed files with 3 additions and 6 deletions

View File

@ -209,8 +209,7 @@ class Render {
node.height = height node.height = height
node.layout() node.layout()
this.mindMap.render(() => { this.mindMap.render(() => {
// 输入框的left不会改变所以无需更新 this.textEdit.updateTextEditNode()
this.textEdit.updateTextEditNode(['left'])
}) })
} }

View File

@ -379,8 +379,7 @@ export default class TextEdit {
} }
// 更新文本编辑框的大小和位置 // 更新文本编辑框的大小和位置
// notChangeProps不会发生改变的属性列表 updateTextEditNode() {
updateTextEditNode(notChangeProps = []) {
if (this.mindMap.richText) { if (this.mindMap.richText) {
this.mindMap.richText.updateTextEditNode() this.mindMap.richText.updateTextEditNode()
return return
@ -393,8 +392,7 @@ export default class TextEdit {
rect.width + this.textNodePaddingX * 2 + 'px' rect.width + this.textNodePaddingX * 2 + 'px'
this.textEditNode.style.minHeight = this.textEditNode.style.minHeight =
rect.height + this.textNodePaddingY * 2 + 'px' rect.height + this.textNodePaddingY * 2 + 'px'
if (!notChangeProps.includes('left')) this.textEditNode.style.left = rect.left + 'px'
this.textEditNode.style.left = rect.left + 'px'
this.textEditNode.style.top = rect.top + 'px' this.textEditNode.style.top = rect.top + 'px'
} }