mirror of
https://github.com/danbulant/cushy
synced 2026-06-15 20:41:19 +00:00
Resize ranges fix
This commit is contained in:
parent
e34d06ac13
commit
b5cdb93bb5
2 changed files with 7 additions and 1 deletions
|
|
@ -62,6 +62,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- `inner_size` and `outer_size` are now initialized after the first layout is
|
||||
performed. This ensures that when `resize_to_fit` is used, the first observed
|
||||
values will be the resized values.
|
||||
- `Resize` now performs a second layout pass, if necessary, to ensure that
|
||||
children widgets have an opportunity to fill the resized area. Additionally,
|
||||
the first SizeToFit measurement will be performed with the minimum dimension.
|
||||
|
||||
### Added
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,10 @@ fn override_constraint(
|
|||
ConstraintLimit::Fill(size) => ConstraintLimit::Fill(range.clamp(size, scale)),
|
||||
ConstraintLimit::SizeToFit(clipped_after) => match (range.minimum(), range.maximum()) {
|
||||
(Some(min), Some(max)) if min == max => ConstraintLimit::Fill(min.into_upx(scale)),
|
||||
_ => ConstraintLimit::SizeToFit(range.clamp(clipped_after, scale)),
|
||||
_ => ConstraintLimit::SizeToFit(range.minimum().map_or_else(
|
||||
|| range.clamp(clipped_after, scale),
|
||||
|min| min.into_upx(scale),
|
||||
)),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue