summaryrefslogtreecommitdiff
path: root/src/layout/mod.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2019-11-17 11:53:59 +0100
committerLaurenz <laurmaedje@gmail.com>2019-11-17 11:53:59 +0100
commit467d7203ee67ce29ce9ba62c9406f5586cb5214a (patch)
treef2097653bdb6ad1b9ab6ed1bbe0c2e504b35c269 /src/layout/mod.rs
parentbd66ebd68344f0d02f5dc6163f7d2aa0b4ded79d (diff)
Remove top-level stack layouter from tree layouter 🗑
Diffstat (limited to 'src/layout/mod.rs')
-rw-r--r--src/layout/mod.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs
index 442747b5..9bb91956 100644
--- a/src/layout/mod.rs
+++ b/src/layout/mod.rs
@@ -150,6 +150,10 @@ pub struct LayoutContext<'a, 'p> {
/// The axes to flow on.
pub axes: LayoutAxes,
+
+ /// Whether to shrink the spaces to fit the content or to keep
+ /// the original dimensions.
+ pub shrink_to_fit: bool,
}
/// A possibly stack-allocated vector of layout spaces.
@@ -163,10 +167,6 @@ pub struct LayoutSpace {
/// Padding that should be respected on each side.
pub padding: SizeBox,
-
- /// Whether to shrink the space to fit the content or to keep
- /// the original dimensions.
- pub shrink_to_fit: bool,
}
impl LayoutSpace {
@@ -182,11 +182,10 @@ impl LayoutSpace {
}
/// A layout space without padding and dimensions reduced by the padding.
- pub fn usable_space(&self, shrink_to_fit: bool) -> LayoutSpace {
+ pub fn usable_space(&self) -> LayoutSpace {
LayoutSpace {
dimensions: self.usable(),
padding: SizeBox::zero(),
- shrink_to_fit,
}
}
}