Method: Geometry::Path#minmax

Defined in:
lib/geometry/path.rb

#minmaxArray<Point>

Returns The lower-left and upper-right corners of the enclosing bounding rectangle.

Returns:

  • (Array<Point>)

    The lower-left and upper-right corners of the enclosing bounding rectangle



76
77
78
# File 'lib/geometry/path.rb', line 76

def minmax
    elements.reduce(elements.first.minmax) {|memo, e| [memo.first.min(e.min), memo.last.max(e.max)] }
end