Skip to content

Instantly share code, notes, and snippets.

@sydlawrence
Created December 17, 2012 10:35
Show Gist options
  • Save sydlawrence/4317332 to your computer and use it in GitHub Desktop.
Save sydlawrence/4317332 to your computer and use it in GitHub Desktop.
snap position to grid
// taken from http://24ways.org/2012/cut-copy-paste/
snappedXpos = floor( xPos / gridSize) * gridSize;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment