Struct axgeom::Rect [−][src]
Stored as two Ranges.
Methods
impl<T: Copy> Rect<T>
[src]
impl<T: Copy> Rect<T>
pub fn new(a: T, b: T, c: T, d: T) -> Rect<T>
[src]
pub fn new(a: T, b: T, c: T, d: T) -> Rect<T>
pub fn get(&self) -> ((T, T), (T, T))
[src]
pub fn get(&self) -> ((T, T), (T, T))
pub fn get_range(
&self,
axis: impl AxisTrait
) -> &Range<T>
[src]
pub fn get_range(
&self,
axis: impl AxisTrait
) -> &Range<T>
pub fn get_range_mut(
&mut self,
axis: impl AxisTrait
) -> &mut Range<T>
[src]
pub fn get_range_mut(
&mut self,
axis: impl AxisTrait
) -> &mut Range<T>
impl<T: PartialOrd + Copy> Rect<T>
[src]
impl<T: PartialOrd + Copy> Rect<T>
pub fn contains_point(&self, a: [T; 2]) -> bool
[src]
pub fn contains_point(&self, a: [T; 2]) -> bool
impl<T: Copy + Sub<Output = T> + Add<Output = T>> Rect<T>
[src]
impl<T: Copy + Sub<Output = T> + Add<Output = T>> Rect<T>
impl<T: Ord + Copy> Rect<T>
[src]
impl<T: Ord + Copy> Rect<T>
pub fn subdivide<A: AxisTrait>(&self, axis: A, divider: T) -> (Rect<T>, Rect<T>)
[src]
pub fn subdivide<A: AxisTrait>(&self, axis: A, divider: T) -> (Rect<T>, Rect<T>)
Subdivides the rectangle. No floating point calculations are done (so no precision loss/rounding issues).
pub fn contains_rect(&self, rect: &Rect<T>) -> bool
[src]
pub fn contains_rect(&self, rect: &Rect<T>) -> bool
Returns true if the specified rect is inside of this rect.
pub fn grow_to_fit(&mut self, rect: &Rect<T>) -> &mut Self
[src]
pub fn grow_to_fit(&mut self, rect: &Rect<T>) -> &mut Self
Grow the rectangle to fit the specified rectangle by replacing values with the specified rectangle. No floating point computations.
pub fn get_intersect_rect(&self, other: &Rect<T>) -> Option<Rect<T>>
[src]
pub fn get_intersect_rect(&self, other: &Rect<T>) -> Option<Rect<T>>
Get an intersecting rectangle. No floating point calculations as the new rectangle is made up of values from this rectangle and the specified rectangle.
Trait Implementations
impl<T: Copy + Copy> Copy for Rect<T>
[src]
impl<T: Copy + Copy> Copy for Rect<T>
impl<T: Clone + Copy> Clone for Rect<T>
[src]
impl<T: Clone + Copy> Clone for Rect<T>
fn clone(&self) -> Rect<T>
[src]
fn clone(&self) -> Rect<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<T: Debug + Copy> Debug for Rect<T>
[src]
impl<T: Debug + Copy> Debug for Rect<T>