UI module

contains

procedureextensionexperimentalsince 0.31.0Source

Whether the point lies inside rect.

Example↗
r := Rect.{ 0, 0, 10, 10 };
assert(contains(r, 0, 0));
assert(!contains(r, 10, 10));
contains :: (rect: Rect, x: float, y: float) -> bool

Whether the point lies inside rect.

Parameters

rect: Rect
the rectangle. Its left and top edges count as inside, its right and bottom edges do not.
x: float
the point's horizontal position.
y: float
the point's vertical position.

Returns

bool
Example↗
r := Rect.{ 0, 0, 10, 10 };
assert(contains(r, 0, 0));
assert(!contains(r, 10, 10));

See also