OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head></head> |
| 4 <body> |
| 5 <canvas id="mycanvas" width="300" height="150"></canvas> |
| 6 <script src="script-tests/js-ellipse-implementation.js"></script> |
| 7 <script> |
| 8 var canvas = document.getElementById('mycanvas'); |
| 9 var ctx = canvas.getContext('2d'); |
| 10 |
| 11 var r; |
| 12 var anticlockwise = true; |
| 13 ctx.beginPath(); |
| 14 for (r = 200; r >= 10; r -= 20) { |
| 15 ctx.moveTo(150 + r, 75); |
| 16 ellipseUsingArc(ctx, 150, 75, r, r * 1.2, 0, 0, Math.PI * 2, anticlockwise); |
| 17 ctx.closePath(); |
| 18 anticlockwise = !anticlockwise; |
| 19 } |
| 20 ctx.fillStyle = 'rgba(0, 255, 0, 1)'; |
| 21 ctx.strokeStyle = 'rgba(0, 255, 0, 1)'; |
| 22 ctx.fill(); |
| 23 ctx.stroke(); |
| 24 </script> |
| 25 </body> |
| 26 </html> |
OLD | NEW |