Struct egui::frame_state::FrameState
source · pub struct FrameState {
pub used_ids: IdMap<Rect>,
pub widgets: WidgetRects,
pub layers: HashMap<LayerId, PerLayerState>,
pub tooltips: TooltipFrameState,
pub available_rect: Rect,
pub unused_rect: Rect,
pub used_by_panels: Rect,
pub scroll_target: [Option<(Rangef, Option<Align>)>; 2],
pub scroll_delta: Vec2,
pub highlight_next_frame: HashSet<Id, BuildIdHasher>,
pub debug_rect: Option<DebugRect>,
}
Expand description
State that is collected during a frame, then saved for the next frame, and then cleared.
One per viewport.
Fields§
§used_ids: IdMap<Rect>
All Id
s that were used this frame.
widgets: WidgetRects
All widgets produced this frame.
layers: HashMap<LayerId, PerLayerState>
Per-layer state.
Not all layers registers themselves there though.
tooltips: TooltipFrameState
§available_rect: Rect
Starts off as the screen_rect
, shrinks as panels are added.
The CentralPanel
does not change this.
This is the area available to Window’s.
unused_rect: Rect
Starts off as the screen_rect
, shrinks as panels are added.
The CentralPanel
retracts from this.
used_by_panels: Rect
How much space is used by panels.
scroll_target: [Option<(Rangef, Option<Align>)>; 2]
The current scroll area should scroll to this range (horizontal, vertical).
scroll_delta: Vec2
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.
highlight_next_frame: HashSet<Id, BuildIdHasher>
Highlight these widgets the next frame.
debug_rect: Option<DebugRect>
Implementations§
source§impl FrameState
impl FrameState
pub(crate) fn begin_frame(&mut self, screen_rect: Rect)
sourcepub(crate) fn available_rect(&self) -> Rect
pub(crate) fn available_rect(&self) -> Rect
How much space is still available after panels has been added. This is the “background” area, what egui doesn’t cover with panels (but may cover with windows). This is also the area to which windows are constrained.
sourcepub(crate) fn allocate_left_panel(&mut self, panel_rect: Rect)
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)
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)
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)
pub(crate) fn allocate_bottom_panel(&mut self, panel_rect: Rect)
Shrink available_rect
.
pub(crate) fn allocate_central_panel(&mut self, panel_rect: Rect)
Trait Implementations§
source§impl Clone for FrameState
impl Clone for FrameState
source§fn clone(&self) -> FrameState
fn clone(&self) -> FrameState
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more