Class: Wx::SF::CrossBarArrow
- Defined in:
- lib/wx/shapes/arrows/cross_bar_arrow.rb
Overview
Class extends the Wx::LineArrow class and encapsulates arrow shape consisting of single crossbar before the end of the parent line shape.
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#draw(from, to, dc) ⇒ Wx::Point
Draw arrow shape at the end of a virtual line.
-
#initialize(parent = nil) ⇒ CrossBarArrow
constructor
Constructor.
- #scale ⇒ Object protected
Methods inherited from LineArrow
#get_pen, #get_pen_width, #set_parent_shape, #set_pen
Methods inherited from ArrowBase
#get_parent_shape, #set_parent_shape, #translate_arrow
Constructor Details
#initialize(parent = nil) ⇒ CrossBarArrow
Constructor
22 23 24 25 |
# File 'lib/wx/shapes/arrows/cross_bar_arrow.rb', line 22 def initialize(parent=nil) super(parent) scale end |
Class Method Details
Instance Method Details
#draw(from, to, dc) ⇒ Wx::Point
Draw arrow shape at the end of a virtual line.
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/wx/shapes/arrows/cross_bar_arrow.rb', line 43 def draw(from, to, dc) = nil dc.with_pen(pen) do |dc| lines.each do |line| , , = translate_arrow(line, from, to) dc.draw_line(, ) end dc.draw_line(, to.to_point) end end |
#scale ⇒ Object (protected)
32 33 34 35 |
# File 'lib/wx/shapes/arrows/cross_bar_arrow.rb', line 32 def scale @lines = nil @ratio = 1 + (pen_width / 2) * 0.5 end |