Skip to main content

split_ratio

Function split_ratio 

Source
pub fn split_ratio(x: f32, width: f32, min_side: f32) -> f32
Expand description

Where a divider dragged to x in a width-wide area leaves it, as the left pane’s share — never so far that either pane is narrower than min_side. An area too narrow for two of those splits evenly, the one answer that favours neither.