pub struct ComputeLayoutCx<'a> {
pub window_state: &'a mut WindowState,
/* private fields */
}Expand description
Context for computing view layout after Taffy has calculated sizes.
This context is used in the second phase of layout, where we traverse the view tree and compute the actual positions of views based on Taffy’s layout calculations.
Fields§
§window_state: &'a mut WindowStateImplementations§
Source§impl<'a> ComputeLayoutCx<'a>
impl<'a> ComputeLayoutCx<'a>
Sourcepub fn window_origin(&self) -> Point
pub fn window_origin(&self) -> Point
Returns the accumulated layout position for child positioning.
This is the visual position (layout + CSS translate) that children use to compute their window positions. Note: this does NOT include the effect of CSS scale/rotate transforms.
pub fn save(&mut self)
pub fn restore(&mut self)
pub fn current_viewport(&self) -> Rect
Sourcepub fn compute_view_layout(&mut self, id: ViewId) -> Option<Rect>
pub fn compute_view_layout(&mut self, id: ViewId) -> Option<Rect>
Compute layout for a view and its children.
Returns the bounding rect that encompasses this view and its children.
Auto Trait Implementations§
impl<'a> Freeze for ComputeLayoutCx<'a>
impl<'a> !RefUnwindSafe for ComputeLayoutCx<'a>
impl<'a> !Send for ComputeLayoutCx<'a>
impl<'a> !Sync for ComputeLayoutCx<'a>
impl<'a> Unpin for ComputeLayoutCx<'a>
impl<'a> !UnwindSafe for ComputeLayoutCx<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more