Skip to content

Instantly share code, notes, and snippets.

@jennschiffer
Last active August 29, 2015 14:24
Show Gist options
  • Save jennschiffer/79d144c509246e86d52a to your computer and use it in GitHub Desktop.
Save jennschiffer/79d144c509246e86d52a to your computer and use it in GitHub Desktop.
draw one diagonal from bottom up
var drawDiagonal = function(x,y,color) {
ctx.fillStyle = color;
ctx.fillRect(x, y, pixelSize, pixelSize);
x = x + pixelSize;
y = y - pixelSize;
if (x >= 0 && y >= 0) {
drawDiagonal(x,y);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment