Permalink
Browse files

Use offset adjusted value in ModulusAnimatedNode

Summary:
Modulus animation computation should use the value adjusted for offset, not the raw value.

See the JS implementation here:
https://github.com/facebook/react-native/blob/master/Libraries/Animated/src/AnimatedImplementation.js#L1338

cc ryangomba
Closes #15502

Differential Revision: D5638901

Pulled By: shergin

fbshipit-source-id: cbf47bd4082897a969e2e561ec090366884a8349
  • Loading branch information...
rozele authored and facebook-github-bot committed Aug 16, 2017
1 parent d0669fc commit fedc002c21fc4d01b3698e9390d968661ccc7801
@@ -31,7 +31,7 @@ public ModulusAnimatedNode(
public void update() {
AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNode);
if (animatedNode != null && animatedNode instanceof ValueAnimatedNode) {
mValue = ((ValueAnimatedNode) animatedNode).mValue % mModulus;
mValue = ((ValueAnimatedNode) animatedNode).getValue() % mModulus;
} else {
throw new JSApplicationCausedNativeException("Illegal node ID set as an input for " +
"Animated.modulus node");

0 comments on commit fedc002

Please sign in to comment.