tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

⎇ 09eca732fb671db2a93f4adfec52108104549b7b src/result.rs Rust · 28 lines · 653 B History Who touched what raw

Improve error handling for index based API 09eca732f · msiglreith ·

1#[cfg(not(feature = "std"))]
2use alloc::vec::Vec;
3
4use crate::algo::ComputeResult;
5use crate::geometry::{Point, Size};
6use crate::number::Number;
7
8#[derive(Copy, Debug, Clone)]
9pub struct Layout {
10    pub(crate) order: u32,
11    pub size: Size<f32>,
12    pub location: Point<f32>,
13}
14
15impl Layout {
16    pub(crate) fn new() -> Self {
17        Layout { order: 0, size: Size { width: 0.0, height: 0.0 }, location: Point { x: 0.0, y: 0.0 } }
18    }
19}
20
21#[derive(Debug, Clone)]
22pub(crate) struct Cache {
23    pub(crate) node_size: Size<Number>,
24    pub(crate) parent_size: Size<Number>,
25    pub(crate) perform_layout: bool,
26
27    pub(crate) result: ComputeResult,
28}