is_position_in_rect

Function is_position_in_rect 

Source
pub fn is_position_in_rect(
    position: PxPosition,
    rect_pos: PxPosition,
    rect_width: Px,
    rect_height: Px,
) -> bool
Expand description

Returns true when position lies within the rectangle defined by rect_pos, rect_width and rect_height (inclusive).

Coordinates use Px units and comparisons are inclusive on edges. The check evaluates X and Y independently and returns true only if both are within bounds.