Class: DYI::Shape::Path::CurveCommand

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

Overview

Since:

  • 0.0.0

Direct Known Subclasses

ShorthandCurveCommand

Instance Attribute Summary

Attributes inherited from CommandBase

#point, #preceding_command

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CurveCommandBase

commands, #initialize, #last_control_point, #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



855
856
857
# File 'lib/dyi/shape/path.rb', line 855

def pt_cnt
  3
end

Instance Method Details

#control_point1Object

Since:

  • 0.0.0



842
843
844
# File 'lib/dyi/shape/path.rb', line 842

def control_point1
  @control_points[0]
end

#control_point2Object

Since:

  • 0.0.0



846
847
848
# File 'lib/dyi/shape/path.rb', line 846

def control_point2
  @control_points[1]
end

#instructions_charObject

Since:

  • 0.0.0



850
851
852
# File 'lib/dyi/shape/path.rb', line 850

def instructions_char
  relative? ? 'c' : 'C'
end

#preceding_control_pointObject

Since:

  • 0.0.0



834
835
836
837
838
839
840
# File 'lib/dyi/shape/path.rb', line 834

def preceding_control_point
  if preceding_command.is_a?(CurveCommand)
    preceding_command.last_control_point
  else
    preceding_command.last_point
  end
end