Struct egui::frame_state::FrameState
source · pub(crate) struct FrameState {
pub(crate) used_ids: IdMap<Rect>,
pub(crate) available_rect: Rect,
pub(crate) unused_rect: Rect,
pub(crate) used_by_panels: Rect,
pub(crate) tooltip_state: Option<TooltipFrameState>,
pub(crate) scroll_delta: Vec2,
pub(crate) scroll_target: [Option<(RangeInclusive<f32>, Option<Align>)>; 2],
pub(crate) highlight_this_frame: HashSet<Id, BuildIdHasher>,
pub(crate) highlight_next_frame: HashSet<Id, BuildIdHasher>,
}
Expand description
State that is collected during a frame and then cleared. Short-term (single frame) memory.
Fields§
§used_ids: IdMap<Rect>
All Id
s that were used this frame.
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.
tooltip_state: Option<TooltipFrameState>
If a tooltip has been shown this frame, where was it?
This is used to prevent multiple tooltips to cover each other.
Initialized to None
at the start of each frame.
scroll_delta: Vec2
Set to InputState::scroll_delta
on the start of each frame.
Cleared by the first ScrollArea
that makes use of it.
scroll_target: [Option<(RangeInclusive<f32>, Option<Align>)>; 2]
horizontal, vertical
highlight_this_frame: HashSet<Id, BuildIdHasher>
Highlight these widgets this next frame. Read from this.
highlight_next_frame: HashSet<Id, BuildIdHasher>
Highlight these widgets the next frame. Write to this.
Implementations§
source§impl FrameState
impl FrameState
pub(crate) fn begin_frame(&mut self, input: &InputState)
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