diff options
| author | Laurenz <laurmaedje@gmail.com> | 2019-10-22 21:40:37 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2019-10-22 21:40:37 +0200 |
| commit | cff325b520727ac0eec46a3757831afaa0916cc1 (patch) | |
| tree | 18cef7a7880fef41050678ab479818e0abb91f14 /src/layout/mod.rs | |
| parent | 991e879e1d2ed53125dbff4edba80804ff28f2a9 (diff) | |
Add spacing functions 🔛
Diffstat (limited to 'src/layout/mod.rs')
| -rw-r--r-- | src/layout/mod.rs | 9 |
1 files changed, 9 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!( |
