(x, y, points, outer, inner, options)
| 2008 | } |
| 2009 | |
| 2010 | function star(x, y, points, outer, inner, options) { |
| 2011 | /* Draws a star with the given points, outer radius and inner radius. |
| 2012 | * The current stroke, strokewidth, strokestyle and fill color are applied. |
| 2013 | */ |
| 2014 | if (points === undefined) points = 20; |
| 2015 | if (outer === undefined) outer = 100; |
| 2016 | if (inner === undefined) inner = 50; |
| 2017 | var p = new Path(); |
| 2018 | p.moveto(x, y+outer); |
| 2019 | for (var i=0; i < 2*points+1; i++) { |
| 2020 | var r = (i%2 == 0)? outer : inner; |
| 2021 | var a = Math.PI * i/points; |
| 2022 | p.lineto(x + r*Math.sin(a), y + r*Math.cos(a)); |
| 2023 | }; |
| 2024 | p.closepath(); |
| 2025 | p.draw(options); |
| 2026 | } |
| 2027 | |
| 2028 | /*##################################################################################################*/ |
| 2029 |
nothing calls this directly
no test coverage detected
searching dependent graphs…