[][src]Struct egui::Region

pub struct Region {
    pub min_rect: Rect,
    pub max_rect: Rect,
    // some fields omitted
}

This describes the bounds and existing contents of an Ui. It is what is used and updated by Layout when adding new widgets.

Fields

min_rect: Rect

This is the minimal size of the Ui. When adding new widgets, this will generally expand.

Always finite.

The bounding box of all child widgets, but not necessarily a tight bounding box since Ui can start with a non-zero min_rect size.

max_rect: Rect

The maximum size of this Ui. This is a soft max meaning new widgets will try not to expand beyond it, but if they have to, they will.

Text will wrap at max_rect.right(). Some widgets (like separator lines) will try to fill the full max_rect width of the ui.

max_rect will always be at least the size of min_rect.

If the max_rect size is zero, it is a signal that child widgets should be as small as possible. If the max_rect size is infinite, it is a signal that child widgets should take up as much room as they want.

Implementations

impl Region[src]

pub fn max_rect_finite(&self) -> Rect[src]

This is like max_rect, but will never be infinite. If the desired rect is infinite ("be as big as you want") this will be bounded by min_rect instead.

pub fn expand_to_include_rect(&mut self, rect: Rect)[src]

Expand the min_rect and max_rect of this ui to include a child at the given rect.

Trait Implementations

impl Clone for Region[src]

impl Copy for Region[src]

impl Debug for Region[src]

Auto Trait Implementations

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.