Stability: stable — changes only in a major release.
A rectangle of cells, in buffer coordinates with the origin at the top
left. Widths and heights are never negative; a zero in either makes the
rectangle empty.
Constructors
The rectangle covering a whole width by height grid.
Sourcewidth cells across and height rows down, with its top left corner at
(x, y). A negative width or height raises.
SourceInstance methods
bottom
Row of the bottom cell. Meaningless for an empty rectangle.
SourceWhether (x, y) falls inside.
Sourcecontains?(other :
Rect) :
Bool Whether other falls entirely inside. An empty rectangle is contained
by anything.
Sourceeach_row
Yields each row index from the top edge down.
Sourceempty?
Whether the rectangle covers no cells.
Sourceintersect(other : Rect) : Rect
The overlap of two rectangles, empty when they do not meet.
Sourceright
Column of the rightmost cell. Meaningless for an empty rectangle.
Source