[][src]Struct egui::math::Rect

pub struct Rect {
    pub min: Pos2,
    pub max: Pos2,
}

A rectangular region of space.

Normally given in points, e.g. logical pixels.

Fields

min: Pos2max: Pos2

Implementations

impl Rect[src]

pub fn everything() -> Self[src]

Infinite rectangle that contains everything

pub fn nothing() -> Self[src]

pub fn invalid() -> Self[src]

invalid, NAN filled Rect.

pub fn from_min_max(min: Pos2, max: Pos2) -> Self[src]

pub fn from_min_size(min: Pos2, size: Vec2) -> Self[src]

pub fn from_center_size(center: Pos2, size: Vec2) -> Self[src]

#[must_use]pub fn expand(self, amnt: f32) -> Self[src]

Expand by this much in each direction, keeping the center

#[must_use]pub fn expand2(self, amnt: Vec2) -> Self[src]

Expand by this much in each direction, keeping the center

#[must_use]pub fn shrink(self, amnt: f32) -> Self[src]

Shrink by this much in each direction, keeping the center

#[must_use]pub fn shrink2(self, amnt: Vec2) -> Self[src]

Shrink by this much in each direction, keeping the center

#[must_use]pub fn translate(self, amnt: Vec2) -> Self[src]

#[must_use]pub fn intersect(self, other: Rect) -> Self[src]

#[must_use]pub fn intersects(self, other: Rect) -> bool[src]

pub fn set_width(&mut self, w: f32)[src]

keep min

pub fn set_height(&mut self, h: f32)[src]

keep min

pub fn set_center(&mut self, center: Pos2)[src]

Keep size

#[must_use]pub fn contains(&self, p: Pos2) -> bool[src]

pub fn extend_with(&mut self, p: Pos2)[src]

pub fn union(self, other: Rect) -> Rect[src]

pub fn center(&self) -> Pos2[src]

pub fn size(&self) -> Vec2[src]

pub fn width(&self) -> f32[src]

pub fn height(&self) -> f32[src]

pub fn area(&self) -> f32[src]

pub fn x_range(&self) -> RangeInclusive<f32>[src]

pub fn y_range(&self) -> RangeInclusive<f32>[src]

pub fn bottom_up_range(&self) -> RangeInclusive<f32>[src]

pub fn is_empty(&self) -> bool[src]

pub fn is_finite(&self) -> bool[src]

pub fn left(&self) -> f32[src]

pub fn right(&self) -> f32[src]

pub fn top(&self) -> f32[src]

pub fn bottom(&self) -> f32[src]

pub fn left_top(&self) -> Pos2[src]

pub fn center_top(&self) -> Pos2[src]

pub fn right_top(&self) -> Pos2[src]

pub fn left_center(&self) -> Pos2[src]

pub fn right_center(&self) -> Pos2[src]

pub fn left_bottom(&self) -> Pos2[src]

pub fn center_bottom(&self) -> Pos2[src]

pub fn right_bottom(&self) -> Pos2[src]

Trait Implementations

impl Clone for Rect[src]

impl Copy for Rect[src]

impl Debug for Rect[src]

impl Eq for Rect[src]

impl From<[Pos2; 2]> for Rect[src]

from (min, max) or (left top, right bottom)

impl PartialEq<Rect> for Rect[src]

impl StructuralEq for Rect[src]

impl StructuralPartialEq for Rect[src]

Auto Trait Implementations

impl RefUnwindSafe for Rect

impl Send for Rect

impl Sync for Rect

impl Unpin for Rect

impl UnwindSafe for Rect

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.