fn nudge(interval: (f64, f64), bounds: (f64, f64)) -> f64 {
        let nudge_up = (bounds.0 - interval.0).max(0.0);
        let nudge_down = (bounds.1 - interval.1).min(0.0);
        if nudge_up > 0.0 {
            nudge_up
        } else {
            nudge_down
        }
    }
// Returns an offset that tries to translate interval to within bounds.
Returns an offset that tries to translate interval to within bounds.
Returns an offset that tries to translate interval to within bounds .
fn nudge(interval: (f64, f64), bounds: (f64, f64)) -> f64 {
        let nudge_up = (bounds.0 - interval.0).max(0.0);
        let nudge_down = (bounds.1 - interval.1).min(0.0);
        if nudge_up > 0.0 {
            nudge_up
        } else {
            nudge_down
        }
    }
fn nudge ( interval : ( f64 , f64 ) , bounds : ( f64 , f64 ) ) -> f64 { let nudge_up = ( bounds . 0 - interval . 0 ) . max ( 0.0 ) ; let nudge_down = ( bounds . 1 - interval . 1 ) . min ( 0.0 ) ; if nudge_up > 0.0 { nudge_up } else { nudge_down } }
Returns an offset that tries to translate interval to within bounds.
Returns an offset that tries to translate interval to within bounds .
interval
(f64, f64)
bounds
(f64, f64)