Method: Astromapper::Svg#polygon

Defined in:
lib/astromapper/svg.rb

#polygon(x, y, sx, sy, sides = 4) ⇒ Object



307
308
309
310
# File 'lib/astromapper/svg.rb', line 307

def polygon(x, y, sx, sy, sides=4)
  polygon = star_coords(sx, sy, sides).map { |c| "#{(x + c[0]).to_i},#{(y.tweak+c[1]).to_i}" }
  "    <polygon points='#{polygon.join(' ')}' />\n"
end