@@ -7,7 +7,7 @@ import { AnimationBase, Properties, CubicBezierAnimationCurve } from './animatio
7
7
import { Trace } from '../../trace' ;
8
8
import { opacityProperty , backgroundColorProperty , rotateProperty , rotateXProperty , rotateYProperty , translateXProperty , translateYProperty , scaleXProperty , scaleYProperty , heightProperty , widthProperty , PercentLength } from '../styling/style-properties' ;
9
9
10
- import { iOSNativeHelper } from '../../utils/native-helper' ;
10
+ import { ios as iosHelper } from '../../utils/native-helper' ;
11
11
12
12
import { Screen } from '../../platform' ;
13
13
@@ -168,33 +168,28 @@ export class Animation extends AnimationBase {
168
168
this . _mergedPropertyAnimations = this . _propertyAnimations ;
169
169
}
170
170
171
- const that = this ;
172
171
const animationFinishedCallback = ( cancelled : boolean ) => {
173
- if ( that . _playSequentially ) {
172
+ if ( this . _playSequentially ) {
174
173
// This function will be called by the last animation when done or by another animation if the user cancels them halfway through.
175
- if ( cancelled ) {
176
- that . _rejectAnimationFinishedPromise ( ) ;
177
- } else {
178
- that . _resolveAnimationFinishedPromise ( ) ;
179
- }
174
+ this . _resolveAnimationFinishedPromise ( ) ;
180
175
} else {
181
176
// This callback will be called by each INDIVIDUAL animation when it finishes or is cancelled.
182
177
if ( cancelled ) {
183
- that . _cancelledAnimations ++ ;
178
+ this . _cancelledAnimations ++ ;
184
179
} else {
185
- that . _finishedAnimations ++ ;
180
+ this . _finishedAnimations ++ ;
186
181
}
187
182
188
- if ( that . _cancelledAnimations > 0 && that . _cancelledAnimations + that . _finishedAnimations === that . _mergedPropertyAnimations . length ) {
183
+ if ( this . _cancelledAnimations > 0 && this . _cancelledAnimations + this . _finishedAnimations === this . _mergedPropertyAnimations . length ) {
189
184
if ( Trace . isEnabled ( ) ) {
190
- Trace . write ( that . _cancelledAnimations + ' animations cancelled.' , Trace . categories . Animation ) ;
185
+ Trace . write ( this . _cancelledAnimations + ' animations cancelled.' , Trace . categories . Animation ) ;
191
186
}
192
- that . _rejectAnimationFinishedPromise ( ) ;
193
- } else if ( that . _finishedAnimations === that . _mergedPropertyAnimations . length ) {
187
+ this . _resolveAnimationFinishedPromise ( ) ;
188
+ } else if ( this . _finishedAnimations === this . _mergedPropertyAnimations . length ) {
194
189
if ( Trace . isEnabled ( ) ) {
195
- Trace . write ( that . _finishedAnimations + ' animations finished.' , Trace . categories . Animation ) ;
190
+ Trace . write ( this . _finishedAnimations + ' animations finished.' , Trace . categories . Animation ) ;
196
191
}
197
- that . _resolveAnimationFinishedPromise ( ) ;
192
+ this . _resolveAnimationFinishedPromise ( ) ;
198
193
}
199
194
}
200
195
} ;
@@ -719,7 +714,7 @@ function calculateTransform(view: View): CATransform3D {
719
714
}
720
715
721
716
expectedTransform = CATransform3DTranslate ( expectedTransform , view . translateX , view . translateY , 0 ) ;
722
- expectedTransform = iOSNativeHelper . applyRotateTransform ( expectedTransform , view . rotateX , view . rotateY , view . rotate ) ;
717
+ expectedTransform = iosHelper . applyRotateTransform ( expectedTransform , view . rotateX , view . rotateY , view . rotate ) ;
723
718
expectedTransform = CATransform3DScale ( expectedTransform , scaleX , scaleY , 1 ) ;
724
719
725
720
return expectedTransform ;
0 commit comments