rosace-layout 0.1.0

Flex layout engine for ROSACE: Column, Row, Stack, Flex, Grid, Wrap
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! The [`LayoutResult`] type returned by every widget's `layout` method.

use rosace_core::types::{Point, Size};

/// Result of a single layout pass for one widget.
///
/// Holds the widget's resolved [`Size`] and the 2-D origin [`Point`] of each
/// child, in the same order the children were supplied to `layout`.
#[derive(Debug, Clone)]
pub struct LayoutResult {
    /// The resolved size of the widget after applying constraints.
    pub size: Size,
    /// The position of each child relative to this widget's origin.
    ///
    /// `child_positions[i]` corresponds to `child_sizes[i]` passed into `layout`.
    pub child_positions: Vec<Point>,
}