Skip to content

Instantly share code, notes, and snippets.

@dennisschaaf
Created December 20, 2011 12:01
Show Gist options
  • Save dennisschaaf/1501351 to your computer and use it in GitHub Desktop.
Save dennisschaaf/1501351 to your computer and use it in GitHub Desktop.
Draw rectangles using canvas.
// Draw a stroked rect
ctx.beginPath();
ctx.rect(10, 10, 100, 100);
ctx.stroke();
// Draw a filled rect
ctx.fillRect(200, 10, 100, 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment