class Savage::Directions::HorizontalTo

Public Instance Methods

command_code() click to toggle source
# File lib/savage/directions/horizontal_to.rb, line 4
def command_code
  (absolute?) ? 'H' : 'h'
end
movement() click to toggle source
# File lib/savage/directions/horizontal_to.rb, line 26
def movement
  [target, nil]
end
to_fully_transformable_dir( pen_x, pen_y ) click to toggle source
# File lib/savage/directions/horizontal_to.rb, line 18
def to_fully_transformable_dir( pen_x, pen_y )
  if absolute?
    LineTo.new( target, pen_y, true )
  else
    LineTo.new( target, 0, false )
  end
end
transform(scale_x, skew_x, skew_y, scale_y, tx, ty) click to toggle source
# File lib/savage/directions/horizontal_to.rb, line 8
def transform(scale_x, skew_x, skew_y, scale_y, tx, ty)

  unless skew_y.zero?
    raise 'rotating or skewing (in Y axis) an "horizontal_to" direction is not supported yet.'
  end
  
  self.target *= scale_x
  self.target += tx if absolute?
end