Class: Savage::Directions::ArcTo
- Inherits:
-
PointTarget
- Object
- Savage::Direction
- PointTarget
- Savage::Directions::ArcTo
- Defined in:
- lib/savage/directions/arc_to.rb
Instance Attribute Summary collapse
-
#large_arc ⇒ Object
Returns the value of attribute large_arc.
-
#radius ⇒ Object
Returns the value of attribute radius.
-
#rotation ⇒ Object
Returns the value of attribute rotation.
-
#sweep ⇒ Object
Returns the value of attribute sweep.
Attributes inherited from PointTarget
Instance Method Summary collapse
- #command_code ⇒ Object
-
#initialize(radius_x, radius_y, rotation, large_arc, sweep, target_x, target_y, absolute = true) ⇒ ArcTo
constructor
A new instance of ArcTo.
- #to_a ⇒ Object
Methods inherited from Savage::Direction
Methods included from Utils
Constructor Details
#initialize(radius_x, radius_y, rotation, large_arc, sweep, target_x, target_y, absolute = true) ⇒ ArcTo
Returns a new instance of ArcTo.
6 7 8 9 10 11 12 |
# File 'lib/savage/directions/arc_to.rb', line 6 def initialize(radius_x, radius_y, rotation, large_arc, sweep, target_x, target_y, absolute=true) super(target_x, target_y, absolute) @radius = Point.new(radius_x, radius_y) @rotation = rotation @large_arc = large_arc.is_a?(Numeric) ? large_arc > 0 : large_arc @sweep = sweep.is_a?(Numeric) ? sweep > 0 : sweep end |
Instance Attribute Details
#large_arc ⇒ Object
Returns the value of attribute large_arc.
4 5 6 |
# File 'lib/savage/directions/arc_to.rb', line 4 def large_arc @large_arc end |
#radius ⇒ Object
Returns the value of attribute radius.
4 5 6 |
# File 'lib/savage/directions/arc_to.rb', line 4 def radius @radius end |
#rotation ⇒ Object
Returns the value of attribute rotation.
4 5 6 |
# File 'lib/savage/directions/arc_to.rb', line 4 def rotation @rotation end |
#sweep ⇒ Object
Returns the value of attribute sweep.
4 5 6 |
# File 'lib/savage/directions/arc_to.rb', line 4 def sweep @sweep end |
Instance Method Details
#command_code ⇒ Object
18 19 20 |
# File 'lib/savage/directions/arc_to.rb', line 18 def command_code (absolute?) ? 'A' : 'a' end |
#to_a ⇒ Object
14 15 16 |
# File 'lib/savage/directions/arc_to.rb', line 14 def to_a [command_code, @radius.x, @radius.y, @rotation, bool_to_int(@large_arc), bool_to_int(@sweep), target.x, target.y] end |