iOS: fix when doAnimation cause flush

This commit is contained in:
pengfei.zhou 2022-07-21 16:53:32 +08:00 committed by osborn
parent 7684eaa896
commit 7bfa542479

View File

@ -566,6 +566,7 @@ - (void)doAnimation:(id)params withPromise:(DoricPromise *)promise {
originDelegate.endBlock(callback);
}
[self transformProperties];
[self.view.layer removeAnimationForKey:params[@"id"]];
[promise resolve:self.transformation];
};
it.cancelBlock = ^{
@ -582,7 +583,7 @@ - (void)doAnimation:(id)params withPromise:(DoricPromise *)promise {
if (params[@"delay"]) {
animation.beginTime = CACurrentMediaTime() + [params[@"delay"] floatValue] / 1000;
}
animation.removedOnCompletion = YES;
animation.removedOnCompletion = NO;
animation.fillMode = kCAFillModeForwards;
if (animation.duration == 0) {
animation.duration = FLT_MIN;