File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -61,15 +61,17 @@ export const MirrorModeling = {
6161 }
6262
6363 // Update hierarchy up
64- function updateParent ( child , child_b ) {
64+ function updateParent ( child : OutlinerNode , child_b : OutlinerNode ) {
6565 let parent = child . parent ;
6666 let parent_b = child_b . parent ;
67- if ( parent == parent_b ) return ;
67+ if ( parent == parent_b || parent == Outliner . ROOT || parent_b == Outliner . ROOT ) return ;
6868 if ( parent . type != parent_b . type ) return ;
6969 if ( parent instanceof OutlinerNode == false || parent . getTypeBehavior ( 'parent' ) != true ) return ;
7070 if ( parent_b instanceof OutlinerNode == false || parent_b . getTypeBehavior ( 'parent' ) != true ) return ;
7171
72+ let before_snapshot = parent_b instanceof Group ? parent_b . getSaveCopy ( ) : undefined ;
7273 MirrorModeling . updateParentNodeCounterpart ( parent_b , parent ) ;
74+ if ( parent_b instanceof Group ) MirrorModeling . insertGroupIntoUndo ( parent_b , undo_aspects , before_snapshot ) ;
7375
7476 updateParent ( parent , parent_b ) ;
7577 }
@@ -233,7 +235,7 @@ export const MirrorModeling = {
233235 // pre
234236 if ( ! Undo . current_save . groups ) Undo . current_save . groups = [ ] ;
235237 if ( before_snapshop ) {
236- if ( Undo . current_save . groups . find ( ( g : any ) => g . uuid == before_snapshop . uuid ) ) {
238+ if ( ! Undo . current_save . groups . find ( ( g : any ) => g . uuid == before_snapshop . uuid ) ) {
237239 Undo . current_save . groups . push ( before_snapshop ) ;
238240 }
239241 } else {
You can’t perform that action at this time.
0 commit comments