react-native/Libraries/NativeAnimation/Nodes/RCTModuloAnimatedNode.m

22 lines
565 B
Mathematica
Raw Normal View History

/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "RCTModuloAnimatedNode.h"
@implementation RCTModuloAnimatedNode
- (void)performUpdate
{
[super performUpdate];
NSNumber *inputNode = self.config[@"input"];
NSNumber *modulus = self.config[@"modulus"];
RCTValueAnimatedNode *parent = (RCTValueAnimatedNode *)[self.parentNodes objectForKey:inputNode];
self.value = fmodf(parent.value, modulus.floatValue);
}
@end