Class: Savage::Directions::VerticalTo
- Inherits:
-
CoordinateTarget
- Object
- Savage::Direction
- CoordinateTarget
- Savage::Directions::VerticalTo
- Defined in:
- lib/savage/directions/vertical_to.rb
Instance Attribute Summary
Attributes inherited from CoordinateTarget
Instance Method Summary collapse
- #command_code ⇒ Object
- #movement ⇒ Object
- #to_fully_transformable_dir(pen_x, pen_y) ⇒ Object
- #transform(scale_x, skew_x, skew_y, scale_y, tx, ty) ⇒ Object
Methods inherited from CoordinateTarget
#fully_transformable?, #initialize, #to_a
Methods inherited from Savage::Direction
#absolute?, #fully_transformable?, #initialize, #relative?, #to_command
Methods included from Transformable
#rotate, #scale, #skew_x, #skew_y, #translate
Methods included from Utils
Constructor Details
This class inherits a constructor from Savage::Directions::CoordinateTarget
Instance Method Details
#command_code ⇒ Object
4 5 6 |
# File 'lib/savage/directions/vertical_to.rb', line 4 def command_code (absolute?) ? 'V' : 'v' end |
#movement ⇒ Object
26 27 28 |
# File 'lib/savage/directions/vertical_to.rb', line 26 def movement [nil, target] end |
#to_fully_transformable_dir(pen_x, pen_y) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/savage/directions/vertical_to.rb', line 18 def to_fully_transformable_dir( pen_x, pen_y ) if absolute? LineTo.new( pen_x, target, true ) else LineTo.new( 0, target, false ) end end |
#transform(scale_x, skew_x, skew_y, scale_y, tx, ty) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/savage/directions/vertical_to.rb', line 8 def transform(scale_x, skew_x, skew_y, scale_y, tx, ty) unless skew_x.zero? raise 'rotating or skewing (in X axis) an "vertical_to" direction is not supported yet.' end self.target *= scale_y self.target += ty if absolute? end |