Skip to content

Instantly share code, notes, and snippets.

@floriancargoet
Created March 17, 2015 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save floriancargoet/20cede87a76b4073177f to your computer and use it in GitHub Desktop.
Save floriancargoet/20cede87a76b4073177f to your computer and use it in GitHub Desktop.
ctx.ellipse polyfill
var ctx = document.getElementById('c').getContext('2d');
function ellipse(context, cx, cy, rx, ry, rot, aStart, aEnd){
context.save();
context.translate(cx, cy);
context.rotate(rot);
context.translate(-rx, -ry);
context.scale(rx, ry);
context.arc(1, 1, 1, aStart, aEnd, false);
context.restore();
}
ctx.beginPath();
ellipse(ctx, 20 + 453.57086, 535.50775, 372.76324, 218.93465, -1.5126187, -2.6609108, 0.9053637999999999);
ctx.stroke();
ctx.beginPath();
ctx.ellipse(453.57086, 535.50775, 372.76324, 218.93465, -1.5126187, -2.6609108, 0.9053637999999999);
ctx.stroke();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment