Skip to content

Instantly share code, notes, and snippets.

@yesasha
Created September 26, 2021 20:33
Show Gist options
  • Select an option

  • Save yesasha/0aa5c2d6e054f84effa838a8394d5cb4 to your computer and use it in GitHub Desktop.

Select an option

Save yesasha/0aa5c2d6e054f84effa838a8394d5cb4 to your computer and use it in GitHub Desktop.
Not a library for canvas. Just copy the needed functions to your project.
function circle (ctx, x, y, r) {
ctx.beginPath();
ctx.arc(x, y, r, 0, 2 * Math.PI, false);
}
function strokeCircle (ctx, x, y, r) {
ctx.beginPath();
ctx.arc(x, y, r, 0, 2 * Math.PI, false);
ctx.stroke();
}
function fillCircle (ctx, x, y, r) {
ctx.beginPath();
ctx.arc(x, y, r, 0, 2 * Math.PI, false);
ctx.fill();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment