pub struct LayoutModifierMeasureResult {
pub size: Size,
pub placement_offset_x: f32,
pub placement_offset_y: f32,
pub alignment_lines: AlignmentLines,
}Expand description
Result of a layout modifier measurement operation.
Unlike MeasureResult which is for MeasurePolicy (multiple children),
this type is specifically for layout modifiers which wrap a single piece
of content and need to specify where that wrapped content should be placed.
Fields§
§size: SizeThe size this modifier will occupy.
placement_offset_x: f32The offset at which to place the wrapped content relative to the top-left corner of this modifier’s bounds. For example, PaddingNode returns (padding.left, padding.top) here to offset the child by the padding amount.
placement_offset_y: f32§alignment_lines: AlignmentLinesExplicit alignment lines. Unspecified lines are inherited from wrapped content.
Implementations§
Source§impl LayoutModifierMeasureResult
impl LayoutModifierMeasureResult
pub fn new(size: Size, placement_offset_x: f32, placement_offset_y: f32) -> Self
Sourcepub fn with_size(size: Size) -> Self
pub fn with_size(size: Size) -> Self
Creates a result with zero placement offset (wrapped content placed at 0,0).
Sourcepub fn with_alignment_lines(self, alignment_lines: AlignmentLines) -> Self
pub fn with_alignment_lines(self, alignment_lines: AlignmentLines) -> Self
Overrides the wrapped content’s alignment lines in this modifier’s coordinates.