Struct axgeom::Rect
[−]
[src]
#[must_use]pub struct Rect<T: Copy + Debug> { /* fields omitted */ }
Stored as two Ranges.
Methods
impl<T: Copy + Debug> Rect<T>
[src]
fn new(a: T, b: T, c: T, d: T) -> Rect<T>
[src]
fn get_range2<X: AxisTrait>(&self) -> &Range<T>
[src]
fn get_range2_mut<X: AxisTrait>(&mut self) -> &mut Range<T>
[src]
fn get_range(&self, axis: Axis) -> &Range<T>
[src]
fn get_range_mut(&mut self, axis: Axis) -> &mut Range<T>
[src]
impl Rect<f32>
[src]
fn from_pos_and_radius(pos: &Vec2, radius: f32) -> Rect<f32>
[src]
Creates a Rect where the pos is in the center, had the edges are spaced a radius away.
fn contains_vec(&self, pos: &Vec2) -> bool
[src]
fn midpoint(&self) -> Vec2
[src]
fn grow(&mut self, val: f32) -> &mut Rect<f32>
[src]
Grow in all directions by val.
impl<T: PartialOrd + PartialEq + Copy + Debug> Rect<T>
[src]
fn subdivide(&self, divider: T, axis: Axis) -> (Rect<T>, Rect<T>)
[src]
Subdivides the rectangle. No floating point calculations are done (so no precision loss/rounding issues).
impl<T: Ord + Copy + Debug> Rect<T>
[src]
fn contains_pos(&self, a: T, b: T) -> bool
[src]
fn contains_rect(&self, rect: &Rect<T>) -> bool
[src]
Returns true if the specified rect is inside of this rect.
fn grow_to_fit(&mut self, rect: &Rect<T>)
[src]
Grow the rectangle to fit the specified rectangle by replacing values with the specified rectangle. No floating point computations.
fn get_intersect_rect(&self, rect: &Rect<T>) -> Option<Rect<T>>
[src]
Get an intersecting rectangle. No floating point calculations as the new rectangle is made up of values from this rectangle and the specified rectangle.
fn intersects_rect(&self, rect: &Rect<T>) -> bool
[src]
Faster than using get_intersect_rect() and checking is_some().
Trait Implementations
impl<T: Copy + Copy + Debug> Copy for Rect<T>
[src]
impl<T: Clone + Copy + Debug> Clone for Rect<T>
[src]
fn clone(&self) -> Rect<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more