[−][src]Function unsegen::widget::layouts::layout_linearly
pub fn layout_linearly<T: AxisDimension + Ord + Debug + Clone>(
available_space: PositiveAxisDiff<T>,
separator_width: PositiveAxisDiff<T>,
demands: &[Demand<T>]
) -> Box<[PositiveAxisDiff<T>]>
Compute assigned lengths for the given demands in one dimension of size available_space
.
Between each length, a gap of separator_width
will be assumed.
This (somewhat ad-hoc) algorithm tries to satisfy these requirements in the following order:
- Each demand should be treated equally.
- Every demands minimum should be honored.
- Each demand should be treated equally, but the assigned length shall not exceed the maximum.
- All space will be distributed.