Constrain padding to inner & outer sizes
This commit is contained in:
parent
82217947aa
commit
2c103f8654
4 changed files with 53 additions and 7 deletions
|
|
@ -293,11 +293,13 @@ pub fn layout<Renderer>(
|
|||
.max_width(max_width)
|
||||
.max_height(max_height)
|
||||
.width(width)
|
||||
.height(height)
|
||||
.pad(padding);
|
||||
.height(height);
|
||||
|
||||
let mut content = layout_content(renderer, &limits.loose());
|
||||
let size = limits.resolve(content.size());
|
||||
let mut content = layout_content(renderer, &limits.pad(padding).loose());
|
||||
|
||||
let padding = padding.constrain(content.size(), limits.max());
|
||||
|
||||
let size = limits.pad(padding).resolve(content.size());
|
||||
|
||||
content.move_to(Point::new(padding.left.into(), padding.top.into()));
|
||||
content.align(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue