From 3ca5b238238e1128aa7bbfbd5db9e632045d8600 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 28 Feb 2022 15:50:48 +0100 Subject: Reorganize library --- src/library/layout/stack.rs | 259 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 259 insertions(+) create mode 100644 src/library/layout/stack.rs (limited to 'src/library/layout/stack.rs') diff --git a/src/library/layout/stack.rs b/src/library/layout/stack.rs new file mode 100644 index 00000000..414490ef --- /dev/null +++ b/src/library/layout/stack.rs @@ -0,0 +1,259 @@ +use super::{AlignNode, SpacingKind}; +use crate::library::prelude::*; + +/// Arrange nodes and spacing along an axis. +#[derive(Debug, Hash)] +pub struct StackNode { + /// The stacking direction. + pub dir: Dir, + /// The spacing between non-spacing children. + pub spacing: Option, + /// The children to be stacked. + pub children: Vec, +} + +#[class] +impl StackNode { + fn construct(_: &mut Context, args: &mut Args) -> TypResult