[][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:

  1. Each demand should be treated equally.
  2. Every demands minimum should be honored.
  3. Each demand should be treated equally, but the assigned length shall not exceed the maximum.
  4. All space will be distributed.