pub struct BoundingRect {
    pub left: i32,
    pub top: i32,
    pub right: i32,
    pub bottom: i32,
}
Expand description

The rectangle that bounds an object

Fields

left: i32top: i32right: i32bottom: i32

Implementations

Calculates the squared distance betweeen the center of two BoundingRects.

Tolerance means: 1. Extend each boundary on both sides by tolerance units along its direction. 2. true is returned iff p lies on either one of the extended boundaries.

A point p lying on boundary “strictly” means this function returns true with p and tolerance set as 0.

For definition of boundary_tolerance, see BoundingRect::have_point_on_boundary().

Given a point on the boundary, return the closest point inside the bounding rect. The behavior is undefined unless ‘p’ is a point on boundary (strictly) and the area of this rect is larger than 1.

Given a point on the boundary, return the closest point outside the bounding rect. Note that if ‘p’ is a corner, there are three closest points, but the diagonal one is always returned. The behavior is undefined unless ‘p’ is a point on boundary (strictly).

Starting from ‘p’, copy the boundary points into a new Vec following the orientation specified by ‘clockwise’ and return it. The behavior is undefined unless ‘p’ is a point on boundary (strictly).

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.