Class: Tuftify::TitlePanel

Inherits:
Panel
  • Object
show all
Defined in:
lib/tuftify/title_panel.rb

Instance Attribute Summary

Attributes inherited from Panel

#canvas, #height, #width, #x, #y

Instance Method Summary collapse

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, options)
  @title = title
  super 0, 0, details[:width], height, details[:canvas], options
  @drawing.pointsize = @options[:title_pointsize]
end

Instance Method Details

#drawObject



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