Skip to content

Instantly share code, notes, and snippets.

@ats
Created May 2, 2010 15:07
Show Gist options
  • Save ats/387186 to your computer and use it in GitHub Desktop.
Save ats/387186 to your computer and use it in GitHub Desktop.
/* Processing code to display a grid overlay for help with layout */
Boolean doGrid = true; // enable or disable measurement grid
int divFactor = 25; // set square size of measurement grid
// display measurements grid if doGrid is true
if (doGrid == true) {
stroke(#3C4F50);
strokeWeight(1);
int vLines = width / divFactor;
int hLines = height / divFactor;
for (i=0; i < width; i=i+divFactor) {
line(i, 0, i, height);
}
for (i=0; i < height; i=i+divFactor) {
line(0, i, width, i);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment