1- import { Easings } from 'konva/lib/Tween' ;
1+ // import { Easings } from 'konva/lib/Tween';
22import React from 'react' ;
33import { Group } from 'react-konva' ;
44
@@ -26,16 +26,14 @@ export class ArraySpreadAnimation extends Animatable {
2626 private resultAnimations : AnimatedTextbox [ ] ;
2727 private arrowAnimation ?: AnimatedGenericArrow < StashItemComponent , Visible > ;
2828 private currCallInstrAnimation : AnimatedTextbox ;
29- private prevCallInstrAnimation : AnimatedTextbox ;
3029
3130 private endX : number ;
3231
3332 constructor (
3433 private controlInstrItem : ControlItemComponent ,
3534 private stashItem : StashItemComponent ,
3635 private resultItems : StashItemComponent [ ] ,
37- private currCallInstrItem : ControlItemComponent ,
38- private prevCallInstrItem : ControlItemComponent
36+ private currCallInstrItem : ControlItemComponent
3937 ) {
4038 super ( ) ;
4139
@@ -52,15 +50,9 @@ export class ArraySpreadAnimation extends Animatable {
5250 } ) ;
5351
5452 // call instr above
55- this . prevCallInstrAnimation = new AnimatedTextbox (
56- this . prevCallInstrItem . text ,
57- { ...getNodePosition ( this . prevCallInstrItem ) , opacity : 0 } ,
58- { rectProps : { stroke : defaultActiveColor ( ) } }
59- ) ;
60-
6153 this . currCallInstrAnimation = new AnimatedTextbox (
6254 this . currCallInstrItem . text ,
63- { ... getNodePosition ( this . currCallInstrItem ) , opacity : 0 } ,
55+ getNodePosition ( this . currCallInstrItem ) ,
6456 { rectProps : { stroke : defaultActiveColor ( ) } }
6557 ) ;
6658
@@ -81,7 +73,6 @@ export class ArraySpreadAnimation extends Animatable {
8173 { this . controlInstrAnimation . draw ( ) }
8274 { this . stashItemAnimation . draw ( ) }
8375 { this . currCallInstrAnimation . draw ( ) }
84- { this . prevCallInstrAnimation . draw ( ) }
8576 { this . resultAnimations . map ( a => a . draw ( ) ) }
8677 { this . arrowAnimation ?. draw ( ) }
8778 </ Group >
@@ -101,17 +92,6 @@ export class ArraySpreadAnimation extends Animatable {
10192
10293 // Move spread instruction next to stash item (array pointer)
10394 await Promise . all ( [
104- // Show change in call arity
105- this . prevCallInstrAnimation . animateTo (
106- { scaleX : 1.1 , scaleY : 1.1 , opacity : 0 } ,
107- { duration : 0.3 , easing : Easings . StrongEaseOut }
108- ) ,
109-
110- this . currCallInstrAnimation . animateTo (
111- { opacity : 1 } ,
112- { duration : 0.3 , easing : Easings . StrongEaseOut }
113- ) ,
114-
11595 ...this . resultAnimations . flatMap ( a => [
11696 a . animateTo (
11797 { x : startX + ( this . endX - startX ) / 2 - this . resultItems [ 0 ] ?. width ( ) / 2 } ,
0 commit comments