pub struct PassState {Show 14 fields
pub used_ids: IdMap<Rect>,
pub widgets: WidgetRects,
pub layers: HashMap<LayerId, PerLayerState>,
pub tooltips: TooltipPassState,
pub root_ui_available_rect: Option<Rect>,
pub root_ui_min_rect: Option<Rect>,
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: IdSet,
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: WidgetRectsAll widgets produced this pass.
layers: HashMap<LayerId, PerLayerState>Per-layer state.
Not all layers registers themselves there though.
tooltips: TooltipPassState§root_ui_available_rect: Option<Rect>What the root UI had available at the end of the previous pass.
Only set if crate::Context::run_ui has been called.
root_ui_min_rect: Option<Rect>What the root UI had used at the end of the previous pass.
Only set if crate::Context::run_ui has been called.
available_rect: RectStarts off as the screen_rect, shrinks as panels are added.
The crate::CentralPanel does not change this.
unused_rect: RectStarts off as the screen_rect, shrinks as panels are added.
The crate::CentralPanel retracts from this.
used_by_panels: RectHow 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: IdSetHighlight these widgets the next pass.
debug_rect: Option<DebugRect>Implementations§
Source§impl PassState
impl PassState
pub(crate) fn begin_pass(&mut self, content_rect: Rect)
Sourcepub(crate) fn available_rect(&self) -> Rect
👎Deprecated: Only used by legacy Context-Panels
pub(crate) fn available_rect(&self) -> Rect
How much space is still available after panels has been added.
Sourcepub(crate) fn allocate_left_panel(&mut self, panel_rect: Rect)
👎Deprecated: Only used by legacy Context-Panels
pub(crate) fn allocate_left_panel(&mut self, panel_rect: Rect)
Shrink available_rect.
Sourcepub(crate) fn allocate_right_panel(&mut self, panel_rect: Rect)
👎Deprecated: Only used by legacy Context-Panels
pub(crate) fn allocate_right_panel(&mut self, panel_rect: Rect)
Shrink available_rect.
Sourcepub(crate) fn allocate_top_panel(&mut self, panel_rect: Rect)
👎Deprecated: Only used by legacy Context-Panels
pub(crate) fn allocate_top_panel(&mut self, panel_rect: Rect)
Shrink available_rect.
Sourcepub(crate) fn allocate_bottom_panel(&mut self, panel_rect: Rect)
👎Deprecated: Only used by legacy Context-Panels
pub(crate) fn allocate_bottom_panel(&mut self, panel_rect: Rect)
Shrink available_rect.