Pad after setting width

Otherwise `width` will set limits back to a fixed width if
`Length::Units` is used, overwriting padding.
This commit is contained in:
Cory Forsstrom 2023-02-14 11:40:29 -08:00
parent 8c5996c12b
commit a9992d131b
No known key found for this signature in database
GPG key ID: 1DFE170A4415C9F5

View file

@ -389,8 +389,8 @@ where
let padding = padding.fit(Size::ZERO, limits.max());
let limits = limits
.pad(padding)
.width(width)
.pad(padding)
.height(Length::Units(text_size));
let mut text = layout::Node::new(limits.resolve(Size::ZERO));