Skip to main content

paperforge_layout/
layout.rs

1use paperforge_core::Rect;
2
3pub struct LayoutEngine {
4    #[allow(dead_code)] // exposed via new(); used once layout math lands
5    viewport: Rect,
6}
7
8impl LayoutEngine {
9    pub fn new(viewport: Rect) -> Self {
10        Self { viewport }
11    }
12
13    pub fn layout(&self) -> LayoutResult {
14        LayoutResult::new()
15    }
16}
17
18impl Default for LayoutEngine {
19    fn default() -> Self {
20        Self::new(Rect::new(0.0, 0.0, 595.0, 842.0))
21    }
22}
23
24pub struct LayoutResult {
25    pub elements: Vec<LayoutElement>,
26}
27
28impl Default for LayoutResult {
29    fn default() -> Self {
30        Self::new()
31    }
32}
33
34impl LayoutResult {
35    pub fn new() -> Self {
36        Self {
37            elements: Vec::new(),
38        }
39    }
40}
41
42pub struct LayoutElement {
43    pub bounds: Rect,
44}