Common attributes for all components, and a standard render method that calls draw after setting up the drawing transformations.
# File lib/scruffy/components/base.rb, line 40 def draw(svg, bounds, options={}) # Override this if visual component end
# File lib/scruffy/components/base.rb, line 44 def process(svg, options={}) # Override this NOT a visual component end
# File lib/scruffy/components/base.rb, line 24 def render(svg, bounds, options={}) if @visible unless bounds.nil? @render_height = bounds[:height] svg.g(:id => id.to_s, :transform => "translate(#{bounds.delete(:x)}, #{bounds.delete(:y)})") { draw(svg, bounds, options.merge(@options)) } else process(svg, options.merge(@options)) end end end
Generated with the Darkfish Rdoc Generator 2.