mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
fix(editor): 添加组件后,只有在位置有调整的情况才再次更新组件
This commit is contained in:
parent
39cd7d8ab7
commit
22c57f444f
@ -315,9 +315,12 @@ class Editor extends BaseService {
|
||||
root: cloneDeep(root),
|
||||
});
|
||||
|
||||
node.style = fixNodePosition(node, parent, stage);
|
||||
const newStyle = fixNodePosition(node, parent, stage);
|
||||
|
||||
await stage?.update({ config: cloneDeep(node), parentId: parent.id, root: cloneDeep(root) });
|
||||
if (newStyle && (newStyle.top !== node.style.top || newStyle.left !== node.style.left)) {
|
||||
node.style = newStyle;
|
||||
await stage?.update({ config: cloneDeep(node), parentId: parent.id, root: cloneDeep(root) });
|
||||
}
|
||||
|
||||
this.addModifiedNodeId(node.id);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user