Class: Wx::SF::DiamondArrow

Inherits:
SolidArrow show all
Defined in:
lib/wx/shapes/arrows/diamond_arrow.rb

Overview

Class extends the Wx::SolidArrow class and encapsulates solid diamond arrow shapes.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SolidArrow

#draw, #initialize, #scale

Methods inherited from FilledArrow

#get_fill, #initialize, #set_fill

Methods inherited from LineArrow

#get_pen, #get_pen_width, #initialize, #scale, #set_parent_shape, #set_pen

Methods inherited from ArrowBase

#draw, #get_parent_shape, #initialize, #set_parent_shape, #translate_arrow

Constructor Details

This class inherits a constructor from Wx::SF::SolidArrow

Class Method Details

.arrow(ratio) ⇒ Object



14
15
16
17
# File 'lib/wx/shapes/arrows/diamond_arrow.rb', line 14

def arrow(ratio)
  x = ratio*10; y = ratio*5
  [Wx::RealPoint.new(0,0), Wx::RealPoint.new(x, y), Wx::RealPoint.new(2*x,0), Wx::RealPoint.new(x,-y), Wx::RealPoint.new(2*x,0)]
end

Instance Method Details

#verticesObject (protected)



21
22
23
# File 'lib/wx/shapes/arrows/diamond_arrow.rb', line 21

def vertices
  @vertices ||= DiamondArrow.arrow(@ratio)
end