lib/geometry/polyline.rb in geometry-6.5 vs lib/geometry/polyline.rb in geometry-6.6

- old
+ new

@@ -39,11 +39,11 @@ first = args.shift if first.is_a?(Point) @vertices.push first elsif first.is_a?(Edge) @edges.push first - @vertices.push *(first.to_a) + @vertices.push(*(first.to_a)) end args.reduce(@vertices.last) do |previous,n| if n.is_a?(Point) if n == previous # Ignore repeated Points @@ -80,11 +80,11 @@ push_edge n.reverse! push_vertex n.last else e = Edge.new(previous, n.first) push_edge e, n - push_vertex *(e.to_a), *(n.to_a) + push_vertex(*(e.to_a), *(n.to_a)) end n.last end end end @@ -165,11 +165,11 @@ end # Clone the receiver, reverse it, then return it # @return [Polyline] the reversed clone def reverse - self.class.new *(edges.reverse.map! {|edge| edge.reverse! }) + self.class.new(*(edges.reverse.map! {|edge| edge.reverse! })) end # Reverse the receiver and return it # @return [Polyline] the reversed receiver def reverse! @@ -259,11 +259,11 @@ end redo # Recheck the modified edges end end - Polyline.new *(active_edges.map {|e| e[:edge]}.compact.map {|e| [e.first, e.last]}.flatten) + Polyline.new(*(active_edges.map {|e| e[:edge]}.compact.map {|e| [e.first, e.last]}.flatten)) end alias :leftset :offset # Rightset the receiver by the specified distance # @param [Number] distance The distance to offset by @@ -367,15 +367,15 @@ end old end def push_edge(*e) - @edges.push *e + @edges.push(*e) @edges.uniq! end def push_vertex(*v) - @vertices.push *v + @vertices.push(*v) @vertices.uniq! end # Remove the first {Edge} and its associated vertices # @return [Edge] the shifted {Edge}