@@ -183,17 +183,21 @@ export class MetaGraph {
183
183
return this . findNodeGraph ( newPath ) ;
184
184
}
185
185
186
- updateGraph ( metaNodeModel : MetaNodeModel , cursorX : number , cursorY : number , isChild ?: boolean ) {
186
+ updateGraph ( metaNodeModel : MetaNodeModel , cursorX : number , cursorY : number ) {
187
187
// update the graph for right parent children relationship
188
188
this . updateNodeContainerBoundingBox ( metaNodeModel ) ;
189
- if ( ! isChild ) {
189
+ if ( ! this . parentUpdating ) {
190
+ this . parentUpdating = true ;
190
191
let parent : MetaNodeModel | undefined = this . rootContainsNode ( metaNodeModel , cursorX , cursorY ) ;
191
192
let newPath = this . findNewPath ( metaNodeModel , parent , cursorX , cursorY ) ;
192
193
if ( metaNodeModel . getGraphPath ( ) . join ( ) . toString ( ) !== newPath . join ( ) . toString ( ) ) {
193
194
this . updateNodeInGraph ( metaNodeModel , newPath ) ;
194
195
}
196
+ this . handleNodePositionChanged ( metaNodeModel ) ;
197
+ this . parentUpdating = false ;
198
+ } else {
199
+ this . handleNodePositionChanged ( metaNodeModel ) ;
195
200
}
196
- this . handleNodePositionChanged ( metaNodeModel ) ;
197
201
}
198
202
199
203
handleNodePositionChanged ( metaNodeModel : MetaNodeModel ) {
@@ -266,7 +270,7 @@ export class MetaGraph {
266
270
*/
267
271
// @ts -ignore
268
272
const localPosition = n . getLocalPosition ( )
269
- n . setChildPosition ( metaNodeModel . getX ( ) + localPosition . x , metaNodeModel . getY ( ) + localPosition . y )
273
+ n . setPosition ( metaNodeModel . getX ( ) + localPosition . x , metaNodeModel . getY ( ) + localPosition . y )
270
274
271
275
} )
272
276
}
@@ -277,7 +281,7 @@ export class MetaGraph {
277
281
}
278
282
279
283
updateNodeContainerBoundingBox ( node : MetaNodeModel ) : void {
280
- node . setContainerBoundingBox ( {
284
+ node . setNodeBoundingBox ( {
281
285
left : node . getX ( ) ,
282
286
top : node . getY ( ) ,
283
287
bottom : node . getY ( ) + node . height ,
0 commit comments