Skip to main content

rosace_layout/
layout_result.rs

1//! The [`LayoutResult`] type returned by every widget's `layout` method.
2
3use rosace_core::types::{Point, Size};
4
5/// Result of a single layout pass for one widget.
6///
7/// Holds the widget's resolved [`Size`] and the 2-D origin [`Point`] of each
8/// child, in the same order the children were supplied to `layout`.
9#[derive(Debug, Clone)]
10pub struct LayoutResult {
11    /// The resolved size of the widget after applying constraints.
12    pub size: Size,
13    /// The position of each child relative to this widget's origin.
14    ///
15    /// `child_positions[i]` corresponds to `child_sizes[i]` passed into `layout`.
16    pub child_positions: Vec<Point>,
17}