Skip to main content

shared

Function shared 

Source
fn shared(
    axis: Axis,
    ratio: f64,
    first: Need,
    second: Need,
    rect: Rect,
    settings: Settings,
) -> f64
Expand description

The ratio a split of rect across axis is drawn at, when it holds ratio and its two children ask first and second of the room (#115).

ratio itself unless exactly one side is under what it pulls towards. Then the seam moves towards the other side by the shortfall, or by as much as the other side has above what it holds, whichever is less: a window under its floor is given the room its siblings can spare and none they cannot (floor_tests::a_window_under_its_floor_takes_room_from_its_sibling and floor_tests::a_sibling_gives_no_more_than_it_holds). With both sides short the seam stays where the user put it, since moving it would take from one window short of room to give to another (floor_tests::two_windows_that_cannot_both_fit_keep_the_users_seam). The span is what cut divides, and cut clamps the result as it clamps every ratio.