diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-11-12 23:25:54 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-11-12 23:46:26 +0100 |
| commit | bf59c08a0a601eeac4354c505cab15e65601c8e8 (patch) | |
| tree | 2ba3230c77960acf5d55ee34065a5028d1c45d5d /library/src/layout/columns.rs | |
| parent | d9ce194fe71076314955dd25896f64d48bccd6e5 (diff) | |
New interaction model
Diffstat (limited to 'library/src/layout/columns.rs')
| -rw-r--r-- | library/src/layout/columns.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/library/src/layout/columns.rs b/library/src/layout/columns.rs index 2faa6329..ec9510d8 100644 --- a/library/src/layout/columns.rs +++ b/library/src/layout/columns.rs @@ -104,10 +104,20 @@ pub struct ColbreakNode { pub weak: bool, } -#[node] +#[node(Behave)] impl ColbreakNode { fn construct(_: &mut Vm, args: &mut Args) -> SourceResult<Content> { let weak = args.named("weak")?.unwrap_or(false); Ok(Self { weak }.pack()) } } + +impl Behave for ColbreakNode { + fn behaviour(&self) -> Behaviour { + if self.weak { + Behaviour::Weak(1) + } else { + Behaviour::Destructive + } + } +} |
