mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-18 03:20:09 +00:00
41 lines
978 B
Objective-C
41 lines
978 B
Objective-C
//
|
|
// LOTPathAnimator.m
|
|
// Pods
|
|
//
|
|
// Created by brandon_withrow on 6/27/17.
|
|
//
|
|
//
|
|
|
|
#import "LOTPathAnimator.h"
|
|
#import "LOTPathInterpolator.h"
|
|
|
|
@implementation LOTPathAnimator {
|
|
LOTShapePath *_pathConent;
|
|
LOTPathInterpolator *_interpolator;
|
|
}
|
|
|
|
- (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nullable)inputNode
|
|
shapePath:(LOTShapePath *_Nonnull)shapePath {
|
|
self = [super initWithInputNode:inputNode keyName:shapePath.keyname];
|
|
if (self) {
|
|
_pathConent = shapePath;
|
|
_interpolator = [[LOTPathInterpolator alloc] initWithKeyframes:_pathConent.shapePath.keyframes];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (NSDictionary *)valueInterpolators {
|
|
return @{@"Path" : _interpolator};
|
|
}
|
|
|
|
- (BOOL)needsUpdateForFrame:(NSNumber *)frame {
|
|
return [_interpolator hasUpdateForFrame:frame];
|
|
|
|
}
|
|
|
|
- (void)performLocalUpdate {
|
|
self.localPath = [_interpolator pathForFrame:self.currentFrame cacheLengths:self.pathShouldCacheLengths];
|
|
}
|
|
|
|
@end
|