@@ -52,7 +52,8 @@ private void SetupSubscriptions()
5252 {
5353 this . WhenAnyValue ( x => x . Node . Transitions . Count ) . Subscribe ( x => UpdatePositionOnTransitionCountChange ( ) ) ;
5454 this . WhenAnyValue ( x => x . Node . IsCollapse ) . Subscribe ( value => UpdateSubscriptionForPosition ( value ) ) ;
55- }
55+ }
56+
5657 }
5758
5859 this . WhenAnyValue ( x => x . Node . Point1 ) . Buffer ( 2 , 1 ) . Subscribe ( value => PositionConnectPoint = PositionConnectPoint . Addition ( value [ 1 ] . Subtraction ( value [ 0 ] ) ) ) ;
@@ -61,7 +62,7 @@ private void UpdateSubscriptionForPosition(bool nodeIsCollapse)
6162 {
6263 if ( ! nodeIsCollapse )
6364 {
64- subscriptionOnNodeWidthChange = this . WhenAnyValue ( x => x . Node . Size . Width ) . Buffer ( 2 , 1 ) . Where ( x => x [ 0 ] >= 80 && x [ 1 ] >= 80 && x [ 1 ] != Node . WidthBeforeCollapse )
65+ subscriptionOnNodeWidthChange = this . WhenAnyValue ( x => x . Node . Size . Width ) . Buffer ( 2 , 1 ) . Where ( x => ( x [ 0 ] >= 80 && x [ 1 ] >= 80 ) )
6566 . Subscribe ( x => UpdatePositionOnWidthChange ( x [ 1 ] - x [ 0 ] ) ) ;
6667 }
6768 else
@@ -74,12 +75,18 @@ private void UpdatePositionOnTransitionCountChange()
7475 if ( ! string . IsNullOrEmpty ( Name ) )
7576 {
7677 int index = Node . Transitions . IndexOf ( this ) ;
77- this . PositionConnectPoint = Node . Output . PositionConnectPoint . Addition ( 0 , index * 19 ) ;
78+ this . PositionConnectPoint = Node . CurrentConnector . PositionConnectPoint . Addition ( 0 , index * 19 ) ;
7879 }
7980 }
8081 private void UpdatePositionOnWidthChange ( double value )
8182 {
82- this . PositionConnectPoint = this . PositionConnectPoint . Addition ( value , 0 ) ;
83+ if ( ! Node . AfterCollapse )
84+ this . PositionConnectPoint = this . PositionConnectPoint . Addition ( value , 0 ) ;
85+
86+ if ( ( Node . AfterCollapse ) & & ( string . IsNullOrEmpty ( this . Name ) ) )
87+ {
88+ Node . AfterCollapse = false ;
89+ }
8390 }
8491 private void UpdateResources ( )
8592 {
0 commit comments