Skip to main content

ferroui_base/layout/
layout_information.rs

1use super::Layoutable;
2use crate::{Rect, Size};
3
4/// Provides access to layout information of a control.
5pub struct LayoutInformation;
6
7impl LayoutInformation {
8    /// Gets the available size constraint passed in the previous layout pass.
9    ///
10    /// Returns the previous control measure constraint, if any.
11    pub fn get_previous_measure_constraint(control: &Layoutable) -> Option<Size> {
12        control.previous_measure()
13    }
14
15    /// Gets the control bounds used in the previous layout arrange pass.
16    ///
17    /// Returns the previous control arrange bounds, if any.
18    pub fn get_previous_arrange_bounds(control: &Layoutable) -> Option<Rect> {
19        control.previous_arrange()
20    }
21}