Class: DYI::Shape::Path::ShorthandCurveCommand
Overview
Instance Attribute Summary
Attributes inherited from CommandBase
#point, #preceding_command
Class Method Summary
collapse
Instance Method Summary
collapse
#preceding_control_point
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, #used_same_command?
Class Method Details
.pt_cnt ⇒ Object
883
884
885
|
# File 'lib/dyi/shape/path.rb', line 883
def pt_cnt
2
end
|
Instance Method Details
#control_point1 ⇒ Object
862
863
864
865
866
867
868
|
# File 'lib/dyi/shape/path.rb', line 862
def control_point1
if relative?
preceding_point - preceding_control_point
else
preceding_point * 2 - preceding_control_point
end
end
|
#control_point2 ⇒ Object
870
871
872
|
# File 'lib/dyi/shape/path.rb', line 870
def control_point2
@control_points[0]
end
|
#instructions_char ⇒ Object
878
879
880
|
# File 'lib/dyi/shape/path.rb', line 878
def instructions_char
relative? ? 's' : 'S'
end
|
#to_compatible_commands(preceding_command) ⇒ Object
874
875
876
|
# File 'lib/dyi/shape/path.rb', line 874
def to_compatible_commands(preceding_command)
CurveCommand.new(relative?, preceding_command, control_point1, control_point2, @point)
end
|