pub struct LayoutDom { /* private fields */ }Expand description
Contains information on how each widget in the DOM is laid out and what events they’re interested in.
Implementations§
Source§impl LayoutDom
impl LayoutDom
Sourcepub fn get(&self, id: WidgetId) -> Option<&LayoutDomNode>
pub fn get(&self, id: WidgetId) -> Option<&LayoutDomNode>
Get a widget’s layout information.
Sourcepub fn get_mut(&mut self, id: WidgetId) -> Option<&mut LayoutDomNode>
pub fn get_mut(&mut self, id: WidgetId) -> Option<&mut LayoutDomNode>
Get a mutable reference to a widget’s layout information.
Sourcepub fn set_unscaled_viewport(&mut self, view: Rect)
pub fn set_unscaled_viewport(&mut self, view: Rect)
Set the viewport of the DOM in unscaled units.
Sourcepub fn set_scale_factor(&mut self, scale: f32)
pub fn set_scale_factor(&mut self, scale: f32)
Set the scale factor to use for layout.
Sourcepub fn scale_factor(&self) -> f32
pub fn scale_factor(&self) -> f32
Get the currently active scale factor.
Sourcepub fn unscaled_viewport(&self) -> Rect
pub fn unscaled_viewport(&self) -> Rect
Get the viewport in unscaled units.
Sourcepub fn calculate_all(&mut self, dom: &Dom, input: &InputState)
pub fn calculate_all(&mut self, dom: &Dom, input: &InputState)
Calculate the layout of all elements in the given DOM.
Sourcepub fn calculate(
&mut self,
dom: &Dom,
input: &InputState,
id: WidgetId,
constraints: Constraints,
) -> Vec2
pub fn calculate( &mut self, dom: &Dom, input: &InputState, id: WidgetId, constraints: Constraints, ) -> Vec2
Calculate the layout of a specific widget.
This function must only be called from
Widget::layout and should only be
called once per widget per layout pass.
Sourcepub fn enable_clipping(&mut self, dom: &Dom)
pub fn enable_clipping(&mut self, dom: &Dom)
Enables clipping for the currently active widget.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LayoutDom
impl RefUnwindSafe for LayoutDom
impl Send for LayoutDom
impl Sync for LayoutDom
impl Unpin for LayoutDom
impl UnwindSafe for LayoutDom
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