@@ -29,7 +29,6 @@ export class ArraySpreadAnimation extends Animatable {
2929 private prevCallInstrAnimation : AnimatedTextbox ;
3030
3131 private endX : number ;
32- private resultItemIsFirst : boolean ;
3332
3433 constructor (
3534 private controlInstrItem : ControlItemComponent ,
@@ -39,7 +38,10 @@ export class ArraySpreadAnimation extends Animatable {
3938 private prevCallInstrItem : ControlItemComponent
4039 ) {
4140 super ( ) ;
42- this . resultItemIsFirst = ( resultItems [ 0 ] ?. index ?? stashItem . index ) === 0 ;
41+
42+ console . log ( stashItem ) ;
43+ console . log ( resultItems ) ;
44+
4345 this . endX = stashItem ! . x ( ) + stashItem ! . width ( ) ;
4446 this . controlInstrAnimation = new AnimatedTextbox (
4547 controlInstrItem . text ,
@@ -97,7 +99,7 @@ export class ArraySpreadAnimation extends Animatable {
9799 getTextWidth ( this . controlInstrItem . text ) + ControlStashConfig . ControlItemTextPadding * 2 ;
98100 const resultX = ( idx : number ) => this . resultItems [ idx ] ?. x ( ) ?? this . stashItem . x ( ) ;
99101 const resultY = this . resultItems [ 0 ] ?. y ( ) ?? this . stashItem . y ( ) ;
100- const startX = resultX ( 0 ) - ( this . resultItemIsFirst ? minInstrWidth : 0 ) ;
102+ const startX = resultX ( 0 ) ;
101103 const fadeDuration = ( ( animationConfig ?. duration ?? 1 ) * 3 ) / 4 ;
102104 const fadeInDelay = ( animationConfig ?. delay ?? 0 ) + ( animationConfig ?. duration ?? 1 ) / 4 ;
103105
@@ -121,7 +123,7 @@ export class ArraySpreadAnimation extends Animatable {
121123 ...this . resultAnimations . flatMap ( a => [
122124
123125 a . animateTo (
124- { x : startX + ( this . endX - startX ) / 2 - this . resultItems [ 0 ] ! . width ( ) / 2 } ,
126+ { x : startX + ( this . endX - startX ) / 2 - this . resultItems [ 0 ] ? .width ( ) / 2 } ,
125127 { duration : 0 }
126128 )
127129 ] ) ,
@@ -131,9 +133,7 @@ export class ArraySpreadAnimation extends Animatable {
131133 x : startX ,
132134 y :
133135 resultY +
134- ( this . resultItemIsFirst
135- ? 0
136- : ( this . resultItems [ 0 ] . height ( ) ?? this . stashItem . height ( ) ) ) ,
136+ ( this . resultItems [ 0 ] ?. height ( ) ?? this . stashItem . height ( ) ) ,
137137 width : minInstrWidth
138138 } ,
139139 animationConfig
0 commit comments