Struct egui::WidgetRects
source · pub struct WidgetRects {
by_layer: HashMap<LayerId, Vec<WidgetRect>>,
by_id: IdMap<(usize, WidgetRect)>,
infos: IdMap<WidgetInfo>,
}
Expand description
Stores the WidgetRect
s of all widgets generated during a single egui update/frame.
All Ui
s have a WidgetRects
, but whether or not their rects are correct
depends on if Ui::interact_bg
was ever called.
Fields§
§by_layer: HashMap<LayerId, Vec<WidgetRect>>
All widgets, in painting order.
by_id: IdMap<(usize, WidgetRect)>
All widgets, by id, and their order in their respective layer
infos: IdMap<WidgetInfo>
Info about some widgets.
Only filled in if the widget is interacted with, or if this is a debug build.
Implementations§
source§impl WidgetRects
impl WidgetRects
sourcepub fn layer_ids(&self) -> impl ExactSizeIterator<Item = LayerId> + '_
pub fn layer_ids(&self) -> impl ExactSizeIterator<Item = LayerId> + '_
All known layers with widgets.
pub fn layers(&self) -> impl Iterator<Item = (&LayerId, &[WidgetRect])> + '_
pub fn get(&self, id: Id) -> Option<&WidgetRect>
sourcepub fn order(&self, id: Id) -> Option<(LayerId, usize)>
pub fn order(&self, id: Id) -> Option<(LayerId, usize)>
In which layer, and in which order in that layer?
pub fn contains(&self, id: Id) -> bool
sourcepub fn get_layer(
&self,
layer_id: LayerId,
) -> impl Iterator<Item = &WidgetRect> + '_
pub fn get_layer( &self, layer_id: LayerId, ) -> impl Iterator<Item = &WidgetRect> + '_
All widgets in this layer, sorted back-to-front.
sourcepub fn insert(&mut self, layer_id: LayerId, widget_rect: WidgetRect)
pub fn insert(&mut self, layer_id: LayerId, widget_rect: WidgetRect)
Insert the given widget rect in the given layer.
pub fn set_info(&mut self, id: Id, info: WidgetInfo)
pub fn info(&self, id: Id) -> Option<&WidgetInfo>
Trait Implementations§
source§impl Clone for WidgetRects
impl Clone for WidgetRects
source§fn clone(&self) -> WidgetRects
fn clone(&self) -> WidgetRects
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Default for WidgetRects
impl Default for WidgetRects
source§fn default() -> WidgetRects
fn default() -> WidgetRects
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WidgetRects
impl RefUnwindSafe for WidgetRects
impl Send for WidgetRects
impl Sync for WidgetRects
impl Unpin for WidgetRects
impl UnwindSafe for WidgetRects
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more