Class: Wx::SF::SquareArrow

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

Overview

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

Constant Summary collapse

SIZE =

Default square size

11

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(size) ⇒ Object



17
18
19
20
# File 'lib/wx/shapes/arrows/square_arrow.rb', line 17

def arrow(size)
  y = size / 2.0
  [Wx::RealPoint.new(0, y), Wx::RealPoint.new(size, y), Wx::RealPoint.new(size, -y), Wx::RealPoint.new(0 ,-y), Wx::RealPoint.new(size, 0)]
end

Instance Method Details

#get_sizeObject Also known as: size

Get the circle radius



25
26
27
# File 'lib/wx/shapes/arrows/square_arrow.rb', line 25

def get_size
  (SIZE * @ratio).to_i
end

#verticesObject (protected)



30
31
32
# File 'lib/wx/shapes/arrows/square_arrow.rb', line 30

def vertices
  @vertices ||= SquareArrow.arrow(get_size)
end