diff options
Diffstat (limited to 'src/layout/fixed.rs')
| -rw-r--r-- | src/layout/fixed.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/layout/fixed.rs b/src/layout/fixed.rs index 60dbe4d6..a9554a07 100644 --- a/src/layout/fixed.rs +++ b/src/layout/fixed.rs @@ -20,7 +20,13 @@ impl Layout for NodeFixed { self.height.map(|h| h.resolve(full.height)).unwrap_or(current.height), ); - let areas = Areas::once(size); + let fill_if = |cond| if cond { Expand::Fill } else { Expand::Fit }; + let expand = Spec::new( + fill_if(self.width.is_some()), + fill_if(self.height.is_some()), + ); + + let areas = Areas::once(size, expand); self.child.layout(ctx, &areas) } } |
