Merge pull request #137 from hecrj/feature/fill-portion

Add `Length::FillPortion` variant
This commit is contained in:
Héctor Ramón 2019-12-31 10:35:51 +01:00 committed by GitHub
commit eb88660074
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 4 deletions

View file

@ -52,7 +52,7 @@ impl Limits {
Length::Shrink => {
self.fill.width = self.min.width;
}
Length::Fill => {
Length::Fill | Length::FillPortion(_) => {
self.fill.width = self.fill.width.min(self.max.width);
}
Length::Units(units) => {
@ -76,7 +76,7 @@ impl Limits {
Length::Shrink => {
self.fill.height = self.min.height;
}
Length::Fill => {
Length::Fill | Length::FillPortion(_) => {
self.fill.height = self.fill.height.min(self.max.height);
}
Length::Units(units) => {