OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head></head> | 3 <head></head> |
4 <body> | 4 <body> |
5 <canvas id="mycanvas" width="600" height="400"></canvas> | 5 <canvas id="mycanvas" width="600" height="400"></canvas> |
6 <script> | 6 <script> |
7 if (window.testRunner) | 7 if (window.testRunner) |
8 testRunner.dumpAsText(true); | 8 testRunner.dumpAsText(true); |
9 | 9 |
10 var canvas = document.getElementById('mycanvas'); | 10 var canvas = document.getElementById('mycanvas'); |
(...skipping 25 matching lines...) Expand all Loading... |
36 if (i == startAngles.length) { | 36 if (i == startAngles.length) { |
37 anticlockwise = true; | 37 anticlockwise = true; |
38 sign = -1; | 38 sign = -1; |
39 } | 39 } |
40 startAngle = startAngles[i % startAngles.length] * sign; | 40 startAngle = startAngles[i % startAngles.length] * sign; |
41 ctx.save(); | 41 ctx.save(); |
42 for (var j = 0; j < sweepAngles.length; j++) { | 42 for (var j = 0; j < sweepAngles.length; j++) { |
43 ctx.save(); | 43 ctx.save(); |
44 ctx.beginPath(); | 44 ctx.beginPath(); |
45 ctx.moveTo(0, 2); | 45 ctx.moveTo(0, 2); |
46 ctx.arc(18, 15, 10, startAngle, startAngle + (sweepAngles[j] * sign), an
ticlockwise); | 46 ctx.ellipse(18, 15, 8, 12, Math.PI / 4, startAngle, startAngle + (sweepA
ngles[j] * sign), anticlockwise); |
47 ctx.lineTo(0, 28); | 47 ctx.lineTo(0, 28); |
48 ctx.stroke(); | 48 ctx.stroke(); |
49 ctx.restore(); | 49 ctx.restore(); |
50 ctx.translate(30, 0); | 50 ctx.translate(30, 0); |
51 } | 51 } |
52 ctx.restore(); | 52 ctx.restore(); |
53 ctx.translate(0, 40); | 53 ctx.translate(0, 40); |
54 } | 54 } |
55 | 55 |
56 </script> | 56 </script> |
57 </body> | 57 </body> |
58 </html> | 58 </html> |
59 | |
OLD | NEW |