class Scruffy::Components::Label

Public Instance Methods

draw(svg, bounds, options={}) click to toggle source
# File lib/scruffy/components/label.rb, line 4
def draw(svg, bounds, options={})
  svg.text(@options[:text],
    :class => 'text',
    :x => (bounds[:width] / 2),
    :y => bounds[:height], 
    'font-size' => relative(100),
    'font-family' => options[:theme].font_family,
    :fill => options[:theme].marker,
    :stroke => 'none', 'stroke-width' => '0',
    'text-anchor' => (@options[:text_anchor] || 'middle'))
end