pub struct SliverPhysicalParentData {
pub paint_offset: Offset,
pub cross_axis_flex: Option<i32>,
}Expand description
Parent data structure used by parents of slivers that position their children using absolute coordinates.
For example, used by crate::RenderViewport.
This data structure is optimized for fast painting, at the cost of requiring additional work during layout when the children change their offsets. It is best used by parents that expect to have few children, especially if those children will themselves be very tall relative to the parent.
Fields§
§paint_offset: OffsetThe position of the child relative to the parent.
This is the distance from the top left visible corner of the parent to the top left visible corner of the sliver.
cross_axis_flex: Option<i32>The cross axis flex factor to use for this sliver child.
If used outside of a SliverCrossAxisGroup widget, this value has no meaning.
If None or zero, the child is inflexible and determines its own size in the cross
axis. If non-zero, the amount of space the child can occupy in the cross axis is
determined by dividing the free space (after placing the inflexible children) according
to the flex factors of the flexible children.
Implementations§
Source§impl SliverPhysicalParentData
impl SliverPhysicalParentData
Sourcepub const fn new() -> SliverPhysicalParentData
pub const fn new() -> SliverPhysicalParentData
Creates parent data with a zero paint offset.
Sourcepub fn apply_paint_transform(&self, transform: &mut Matrix4)
pub fn apply_paint_transform(&self, transform: &mut Matrix4)
Apply the paint_offset to the given transform.
Used to implement RenderObject::apply_paint_transform by slivers that use
SliverPhysicalParentData.