lib/squib/api/shapes.rb in squib-0.0.4 vs lib/squib/api/shapes.rb in squib-0.0.5

- old
+ new

@@ -1,13 +1,13 @@ module Squib class Deck - + # Draw a rounded rectangle - # - # @example + # + # @example # rect x: 0, y: 0, width: 825, height: 1125, radius: 25 - # + # # Options support Arrays, see {file:README.md#Arrays_and_Singleton_Expansion Arrays and Singleon Expansion} # # @option opts range [Enumerable, :all] (:all) the range of cards over which this will be rendered. See {file:README.md#Specifying_Ranges Specifying Ranges} # @option opts x [Integer] (0) the x-coordinate to place # @option opts y [Integer] (0) the y-coordinate to place @@ -24,20 +24,20 @@ # @api public def rect(opts = {}) opts = needs(opts, [:range, :x, :y, :width, :height, :rect_radius, :x_radius, :y_radius, :fill_color, :stroke_color, :stroke_width, :layout]) opts[:range].each do |i| - @cards[i].rect(opts[:x][i], opts[:y][i], opts[:width][i], opts[:height][i], - opts[:x_radius][i], opts[:y_radius][i], - opts[:fill_color][i], opts[:stroke_color][i], + @cards[i].rect(opts[:x][i], opts[:y][i], opts[:width][i], opts[:height][i], + opts[:x_radius][i], opts[:y_radius][i], + opts[:fill_color][i], opts[:stroke_color][i], opts[:stroke_width][i]) end end # Draw a circle centered at the given coordinates - # - # @example + # + # @example # circle x: 0, y: 0, radius: 100 # # Options support Arrays, see {file:README.md#Arrays_and_Singleton_Expansion Arrays and Singleon Expansion} # # @option opts range [Enumerable, :all] (:all) the range of cards over which this will be rendered. See {file:README.md#Specifying_Ranges Specifying Ranges} @@ -52,18 +52,18 @@ def circle(opts = {}) opts = {radius: 100}.merge(opts) opts = needs(opts, [:range, :x, :y, :circle_radius, :layout, :fill_color, :stroke_color, :stroke_width]) opts[:range].each do |i| - @cards[i].circle(opts[:x][i], opts[:y][i], opts[:radius][i], + @cards[i].circle(opts[:x][i], opts[:y][i], opts[:radius][i], opts[:fill_color][i], opts[:stroke_color][i], opts[:stroke_width][i]) end end # Draw a triangle using the given coordinates - # - # @example + # + # @example # triangle :x1 => 0, :y1 => 0, :x2 => 50, :y2 => 50, :x3 => 0, :y3 => 50 # # Options support Arrays, see {file:README.md#Arrays_and_Singleton_Expansion Arrays and Singleon Expansion} # # @option opts range [Enumerable, :all] (:all) the range of cards over which this will be rendered. See {file:README.md#Specifying_Ranges Specifying Ranges} @@ -80,21 +80,21 @@ # @api public def triangle(opts = {}) opts = needs(opts, [:range, :x1, :y1, :x2, :y2, :x3, :y3, :layout, :fill_color, :stroke_color, :stroke_width]) opts[:range].each do |i| - @cards[i].triangle(opts[:x1][i], opts[:y1][i], - opts[:x2][i], opts[:y2][i], - opts[:x3][i], opts[:y3][i], - opts[:fill_color][i], opts[:stroke_color][i], + @cards[i].triangle(opts[:x1][i], opts[:y1][i], + opts[:x2][i], opts[:y2][i], + opts[:x3][i], opts[:y3][i], + opts[:fill_color][i], opts[:stroke_color][i], opts[:stroke_width][i]) end end # Draw a line using the given coordinates - # - # @example + # + # @example # triangle :x1 => 0, :y1 => 0, :x2 => 50, :y2 => 50 # # @option opts range [Enumerable, :all] (:all) the range of cards over which this will be rendered. See {file:README.md#Specifying_Ranges Specifying Ranges} # @option opts x1 [Integer] (0) the x-coordinate to place # @option opts y1 [Integer] (0) the y-coordinate to place @@ -110,8 +110,8 @@ opts[:range].each do |i| @cards[i].line(opts[:x1][i], opts[:y1][i], opts[:x2][i], opts[:y2][i], opts[:stroke_color][i], opts[:stroke_width][i]) end end - + end -end \ No newline at end of file +end