Struct PassState

Source
pub struct PassState {
    pub used_ids: IdMap<Rect>,
    pub widgets: WidgetRects,
    pub layers: HashMap<LayerId, PerLayerState>,
    pub tooltips: TooltipPassState,
    pub available_rect: Rect,
    pub unused_rect: Rect,
    pub used_by_panels: Rect,
    pub scroll_target: [Option<ScrollTarget>; 2],
    pub scroll_delta: (Vec2, ScrollAnimation),
    pub accesskit_state: Option<AccessKitPassState>,
    pub highlight_next_pass: IntSet<Id>,
    pub debug_rect: Option<DebugRect>,
}
Expand description

State that is collected during a pass, then saved for the next pass, and then cleared.

(NOTE: we usually run only one pass per frame).

One per viewport.

Fields§

§used_ids: IdMap<Rect>

All Ids that were used this pass.

§widgets: WidgetRects

All widgets produced this pass.

§layers: HashMap<LayerId, PerLayerState>

Per-layer state.

Not all layers registers themselves there though.

§tooltips: TooltipPassState§available_rect: Rect

Starts off as the screen_rect, shrinks as panels are added. The crate::CentralPanel does not change this.

§unused_rect: Rect

Starts off as the screen_rect, shrinks as panels are added. The crate::CentralPanel retracts from this.

§used_by_panels: Rect

How much space is used by panels.

§scroll_target: [Option<ScrollTarget>; 2]

The current scroll area should scroll to this range (horizontal, vertical).

§scroll_delta: (Vec2, ScrollAnimation)

The current scroll area should scroll by this much.

The delta dictates how the content should move.

A positive X-value indicates the content is being moved right, as when swiping right on a touch-screen or track-pad with natural scrolling.

A positive Y-value indicates the content is being moved down, as when swiping down on a touch-screen or track-pad with natural scrolling.

§accesskit_state: Option<AccessKitPassState>§highlight_next_pass: IntSet<Id>

Highlight these widgets the next pass.

§debug_rect: Option<DebugRect>

Implementations§

Source§

impl PassState

Source

pub(crate) fn begin_pass(&mut self, screen_rect: Rect)

Source

pub(crate) fn available_rect(&self) -> Rect

How much space is still available after panels has been added.

Source

pub(crate) fn allocate_left_panel(&mut self, panel_rect: Rect)

Shrink available_rect.

Source

pub(crate) fn allocate_right_panel(&mut self, panel_rect: Rect)

Shrink available_rect.

Source

pub(crate) fn allocate_top_panel(&mut self, panel_rect: Rect)

Shrink available_rect.

Source

pub(crate) fn allocate_bottom_panel(&mut self, panel_rect: Rect)

Shrink available_rect.

Source

pub(crate) fn allocate_central_panel(&mut self, panel_rect: Rect)

Trait Implementations§

Source§

impl Clone for PassState

Source§

fn clone(&self) -> PassState

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for PassState

Source§

fn default() -> Self

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

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,