Class: Tuftify::TitlePanel
Instance Attribute Summary
Attributes inherited from Panel
#canvas, #height, #width, #x, #y
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(title, height, details, options) ⇒ TitlePanel
constructor
A new instance of TitlePanel.
Constructor Details
#initialize(title, height, details, options) ⇒ TitlePanel
Returns a new instance of TitlePanel.
5 6 7 8 9 |
# File 'lib/tuftify/title_panel.rb', line 5 def initialize(title, height, details, ) @title = title super 0, 0, details[:width], height, details[:canvas], @drawing.pointsize = @options[:title_pointsize] end |
Instance Method Details
#draw ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/tuftify/title_panel.rb', line 11 def draw @drawing.fill_opacity(0) @drawing.stroke('red') @drawing.stroke_width(3) #@drawing.rectangle(@x,@y,@width,@height+@y) @drawing.annotate(@canvas, @width, @height, 0, 0, @title) @drawing.draw(@canvas) end |