Class: Scruffy::Components::Title
- Defined in:
- lib/scruffy/components/title.rb
Instance Attribute Summary
Attributes inherited from Base
#id, #options, #position, #size, #visible
Instance Method Summary collapse
Methods inherited from Base
#initialize, #process, #render
Constructor Details
This class inherits a constructor from Scruffy::Components::Base
Instance Method Details
#draw(svg, bounds, options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/scruffy/components/title.rb', line 4 def draw(svg, bounds, ={}) if [:title] svg.text([:title], :class => 'title', :x => (bounds[:width] / 2), :y => bounds[:height], 'font-size' => relative(100), 'font-family' => [:theme].font_family, :fill => [:theme].marker, :stroke => 'none', 'stroke-width' => '0', 'text-anchor' => (@options[:text_anchor] || 'middle')) end end |