Skip to content

Instantly share code, notes, and snippets.

@zachgibson
Last active October 14, 2018 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zachgibson/5390fee7f11b6a4692741e4e16f411e6 to your computer and use it in GitHub Desktop.
Save zachgibson/5390fee7f11b6a4692741e4e16f411e6 to your computer and use it in GitHub Desktop.
import Animated from "react-native-reanimated";
const { add, sub, abs } = Animated;
this.xyVal = add(
abs(sub(props.left + TILE_WIDTH / 2 - width / 2, props.x)),
abs(sub(props.top + TILE_HEIGHT / 2 - height / 2, props.y))
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment