Created
March 17, 2015 18:41
-
-
Save floriancargoet/20cede87a76b4073177f to your computer and use it in GitHub Desktop.
ctx.ellipse polyfill
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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