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
ece1bab5c0
commit
bb5e192dcd
@ -339,9 +339,10 @@ class Editor extends BaseService {
|
|||||||
|
|
||||||
if (`${newConfig.id}` === `${this.get('node').id}`) {
|
if (`${newConfig.id}` === `${this.get('node').id}`) {
|
||||||
this.set('node', newConfig);
|
this.set('node', newConfig);
|
||||||
this.get<StageCore | null>('stage')?.update({ config: cloneDeep(newConfig), root: this.get('root') });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.get<StageCore | null>('stage')?.update({ config: cloneDeep(newConfig), root: this.get('root') });
|
||||||
|
|
||||||
if (newConfig.type === NodeType.PAGE) {
|
if (newConfig.type === NodeType.PAGE) {
|
||||||
this.set('page', newConfig);
|
this.set('page', newConfig);
|
||||||
}
|
}
|
||||||
@ -520,7 +521,11 @@ class Editor extends BaseService {
|
|||||||
this.isHistoryStateChange = true;
|
this.isHistoryStateChange = true;
|
||||||
await this.update(value.data);
|
await this.update(value.data);
|
||||||
this.set('modifiedNodeIds', value.modifiedNodeIds);
|
this.set('modifiedNodeIds', value.modifiedNodeIds);
|
||||||
setTimeout(() => value.nodeId && this.select(value.nodeId), 0);
|
setTimeout(async () => {
|
||||||
|
if (!value.nodeId) return;
|
||||||
|
await this.select(value.nodeId);
|
||||||
|
this.get<StageCore | null>('stage')?.select(value.nodeId);
|
||||||
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async toggleFixedPosition(dist: MNode, src: MNode, root: MApp) {
|
private async toggleFixedPosition(dist: MNode, src: MNode, root: MApp) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user