Class: DYI::Shape::Path::ShorthandQuadraticCurveCommand

Inherits:
QuadraticCurveCommand show all
Defined in:
lib/dyi/shape/path.rb

Overview

Since:

  • 0.0.0

Instance Attribute Summary

Attributes inherited from CommandBase

#point, #preceding_command

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from QuadraticCurveCommand

#preceding_control_point, #to_compatible_commands

Methods inherited from CurveCommandBase

commands, #initialize, #to_concise_syntax_fragments

Methods inherited from CommandBase

#absolute?, absolute_commands, #initialize, #last_point, #preceding_point, #relative?, relative_commands, #start_point, #to_compatible_commands, #used_same_command?

Constructor Details

This class inherits a constructor from DYI::Shape::Path::CurveCommandBase

Class Method Details

.pt_cntObject

Since:

  • 0.0.0



937
938
939
# File 'lib/dyi/shape/path.rb', line 937

def pt_cnt
  1
end

Instance Method Details

#control_pointObject

Since:

  • 0.0.0



920
921
922
923
924
925
926
# File 'lib/dyi/shape/path.rb', line 920

def control_point
  if relative?
    preceding_point - preceding_control_point
  else
    preceding_point * 2 - preceding_control_point
  end
end

#instructions_charObject

Since:

  • 0.0.0



932
933
934
# File 'lib/dyi/shape/path.rb', line 932

def instructions_char
  relative? ? 't' : 'T'
end

#last_control_pointObject

Since:

  • 0.0.0



928
929
930
# File 'lib/dyi/shape/path.rb', line 928

def last_control_point
  preceding_point * 2 - preceding_control_point
end