fix: autosize layout limits
This commit is contained in:
parent
b524ccb0a4
commit
ff0ba4860c
1 changed files with 9 additions and 11 deletions
|
|
@ -112,23 +112,21 @@ where
|
||||||
&self,
|
&self,
|
||||||
tree: &mut Tree,
|
tree: &mut Tree,
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
_limits: &layout::Limits,
|
limits: &layout::Limits,
|
||||||
) -> layout::Node {
|
) -> layout::Node {
|
||||||
let mut limits = self.limits;
|
let mut my_limits = self.limits;
|
||||||
let min = self.limits.min();
|
let min = limits.min();
|
||||||
let max = self.limits.max();
|
let max = limits.max();
|
||||||
if self.auto_width {
|
if !self.auto_width {
|
||||||
limits.min_width(min.width);
|
my_limits = limits.min_width(min.width).max_width(max.width);
|
||||||
limits.max_width(max.width);
|
|
||||||
}
|
}
|
||||||
if self.auto_height {
|
if !self.auto_height {
|
||||||
limits.min_height(min.height);
|
my_limits = limits.min_height(min.height).max_height(max.height);
|
||||||
limits.max_height(max.height);
|
|
||||||
}
|
}
|
||||||
let node = self
|
let node = self
|
||||||
.content
|
.content
|
||||||
.as_widget()
|
.as_widget()
|
||||||
.layout(&mut tree.children[0], renderer, &self.limits);
|
.layout(&mut tree.children[0], renderer, &my_limits);
|
||||||
let size = node.size();
|
let size = node.size();
|
||||||
layout::Node::with_children(size, vec![node])
|
layout::Node::with_children(size, vec![node])
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue