diff options
Diffstat (limited to 'src/layout')
| -rw-r--r-- | src/layout/mod.rs | 9 | ||||
| -rw-r--r-- | src/layout/tree.rs | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 470ac3ba..34c9b35a 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -40,6 +40,15 @@ pub struct Layout { } impl Layout { + /// Create an empty layout with the specified dimensions. + pub fn empty(width: Size, height: Size) -> Layout { + Layout { + dimensions: Size2D::new(width, height), + actions: vec![], + debug_render: true, + } + } + /// Serialize this layout into an output buffer. pub fn serialize<W: Write>(&self, f: &mut W) -> io::Result<()> { writeln!( diff --git a/src/layout/tree.rs b/src/layout/tree.rs index 3a58115f..a0cb1434 100644 --- a/src/layout/tree.rs +++ b/src/layout/tree.rs @@ -124,6 +124,8 @@ impl<'a, 'p> TreeLayouter<'a, 'p> { self.start_new_flex(); } + Command::AddFlex(layout) => self.flex.add(layout), + Command::SetAlignment(alignment) => { self.finish_flex()?; self.alignment = alignment; |
