Implementing initial layout functionality

This commit is contained in:
Andy Meneely
2014-07-29 14:17:38 -04:00
parent 20bd850bb7
commit b0e65d3783
10 changed files with 99 additions and 9 deletions
+2 -2
View File
@@ -16,7 +16,7 @@ module Squib
# @return [nil] Returns nil
# @api public
def png(opts = {})
opts = needs(opts, [:range, :files, :x, :y, :alpha])
opts = needs(opts, [:range, :files, :x, :y, :alpha, :layout])
opts[:range].each do |i|
@cards[i].png(opts[:file][i], opts[:x], opts[:y], opts[:alpha])
end
@@ -37,7 +37,7 @@ module Squib
# @return [nil] Returns nil
# @api public
def svg(opts = {})
p = needs(opts,[:range, :files, :svgid, :x, :y, :width, :height])
p = needs(opts,[:range, :files, :svgid, :x, :y, :width, :height, :layout])
p[:range].each do |i|
@cards[i].svg(p[:file][i], p[:id], p[:x], p[:y], p[:width], p[:height])
end
+1 -1
View File
@@ -20,7 +20,7 @@ module Squib
# @api public
def rect(opts = {})
opts = needs(opts, [:range, :x, :y, :width, :height, :radius,
:fill_color, :stroke_color, :stroke_width])
:fill_color, :stroke_color, :stroke_width, :layout])
opts[:range].each do |i|
@cards[i].rect(opts[:x], opts[:y], opts[:width], opts[:height],
opts[:x_radius], opts[:y_radius],
+1 -1
View File
@@ -34,7 +34,7 @@ module Squib
# @api public
def text(opts = {})
opts = needs(opts, [:range, :str, :font, :x, :y, :width, :height, :text_color, :wrap,
:align, :justify, :valign, :ellipsize, :hint])
:align, :justify, :valign, :ellipsize, :hint, :layout])
opts[:str] = [opts[:str]] * @cards.size unless opts[:str].respond_to? :each
opts[:range].each do |i|
@cards[i].text(opts[:str][i], opts[:font], opts[:x], opts[:y], opts[:color], opts)