Class | Origami::Graphics::Path |
In: |
sources/parser/graphics/path.rb
|
Parent: | Object |
current_point | [RW] | |
segments | [R] |
# File sources/parser/graphics/path.rb, line 76 76: def initialize 77: @segments = [] 78: @current_point = nil 79: @closed = false 80: end
# File sources/parser/graphics/path.rb, line 95 95: def add_segment(seg) 96: raise GraphicsStateError, "Cannot modify closed subpath" if is_closed? 97: 98: @segments << seg 99: @current_point = seg.to 100: end
# File sources/parser/graphics/path.rb, line 86 86: def close! 87: from = @current_point 88: to = @segments.first.from 89: 90: @segments << Line.new(from, to) 91: @segments.freeze 92: @closed = true 93: end