reduce number of space modules

This commit is contained in:
🪞👃🪞 2024-12-30 13:13:29 +01:00
parent 35a88cb70f
commit 61b447403b
14 changed files with 599 additions and 623 deletions

View file

@ -8,23 +8,20 @@ use std::fmt::{Display, Debug};
//////////////////////////////////////////////////////
pub(crate) mod align;
pub(crate) mod cond; pub(crate) use cond::*;
pub(crate) mod fill;
pub(crate) mod fixed; pub(crate) use fixed::*;
pub(crate) mod inset_outset; pub(crate) use inset_outset::*;
pub(crate) mod layers; pub(crate) use layers::*;
pub(crate) mod measure; pub(crate) use measure::*;
pub use self::measure::Measure;
pub(crate) mod min_max; pub(crate) use min_max::*;
pub(crate) mod push_pull; pub(crate) use push_pull::*;
pub(crate) mod cond; pub(crate) use cond::*;
pub(crate) mod layers; pub(crate) use layers::*;
pub(crate) mod measure; pub(crate) use measure::*;
pub(crate) mod position; pub(crate) use position::*;
pub(crate) mod scroll;
pub(crate) mod shrink_grow; pub(crate) use shrink_grow::*;
pub(crate) mod split; pub(crate) use split::*;
pub(crate) mod stack; pub(crate) use stack::*;
pub(crate) mod size; pub(crate) use size::*;
pub(crate) mod split; pub(crate) use split::*;
pub use self::{
align::*,
fill::*,
cond::*,
measure::*,
position::*,
size::*,
split::*,
};
@ -234,3 +231,15 @@ impl<N: Coordinate> Area<N> for [N;4] {
Stack::right(move|add|{ for $pat in $collection { add(&$item)?; } Ok(()) })
};
}
#[macro_export] macro_rules! lay {
([$($expr:expr),* $(,)?]) => {
Layers::new(move|add|{ $(add(&$expr)?;)* Ok(()) })
};
(![$($expr:expr),* $(,)?]) => {
Layers::new(|add|{ $(add(&$expr)?;)* Ok(()) })
};
($expr:expr) => {
Layers::new($expr)
};
}