Skip to content

Commit

Permalink
Use offset adjusted value in ModulusAnimatedNode
Browse files Browse the repository at this point in the history
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 fedc002
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit fedc002

Please sign in to comment.