RectX extension

Geometry helpers for Rect.

on

Methods

containsOffset(Offset offset) → bool

Available on Rect, provided by the RectX extension

Check if {offset} is inside the rectangle
divideRect() → (Rect, Rect, Rect, Rect)

Available on Rect, provided by the RectX extension

Splits the rect into four equal quadrants.
getFarthestPoint(Offset offset) → Offset

Available on Rect, provided by the RectX extension

Get the farthest corner from {offset}
getNearestPoint(Offset offset) → Offset

Available on Rect, provided by the RectX extension

Get the nearest corner from {offset}
randomOffset() → Offset

Available on Rect, provided by the RectX extension

Get random offset inside the rectangle