Implementing initial layout functionality
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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],
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user