mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-21 03:29:54 +00:00
fixed a bug where setting CABasicAnimation beginTime would cause the animation to be delayed
This commit is contained in:
@@ -336,7 +336,9 @@ static NSString * const kCompContainerAnimationKey = @"play";
|
||||
animation.delegate = self;
|
||||
animation.removedOnCompletion = NO;
|
||||
if (offset != 0) {
|
||||
animation.beginTime = CACurrentMediaTime() - (offset * 1 / _animationSpeed);
|
||||
CFTimeInterval currentTime = CACurrentMediaTime();
|
||||
CFTimeInterval currentLayerTime = [self.layer convertTime:currentTime fromLayer:nil];
|
||||
animation.beginTime = currentLayerTime - (offset * 1 / _animationSpeed);
|
||||
}
|
||||
[_compContainer addAnimation:animation forKey:kCompContainerAnimationKey];
|
||||
_compContainer.shouldRasterize = NO;
|
||||
|
||||
Reference in New Issue
Block a user