Adding stroke and fill to rect

This commit is contained in:
Andy Meneely
2014-07-22 14:30:24 -04:00
parent d34e4729ce
commit bda920ebe6
2 changed files with 9 additions and 4 deletions
+3 -2
View File
@@ -2,12 +2,13 @@ module Squib
class Deck
def rect(range: :all, x: 0, y: 0, width: 825, height: 1125, \
radius: 0, x_radius: 0, y_radius: 0, color: :black)
radius: nil, x_radius: 0, y_radius: 0, \
fill_color: '#0000', stroke_color: :black, stroke_width: 2.0)
range = rangeify(range)
color = colorify(color)
x_radius,y_radius = radiusify(radius, x_radius, y_radius)
range.each do |i|
@cards[i].draw_rectangle(x, y, width, height, x_radius, y_radius, color)
@cards[i].draw_rectangle(x, y, width, height, x_radius, y_radius, fill_color, stroke_color, stroke_width)
end
end