fn calculate_split_points(
    timer: &Timer,
    draw_info: &mut DrawInfo,
    comparison: &str,
    show_best_segments: bool,
) {
    let timing_method = timer.current_timing_method();

    for (i, segment) in timer.run().segments()[..draw_info.split_index]
        .iter()
        .enumerate()
    {
        catch! {
            let split_time = segment.split_time()[timing_method]?;
            let comparison_time = segment.comparison(comparison)[timing_method]?;
            let delta = (split_time - comparison_time).total_seconds() as f32;

            if delta > draw_info.max_delta {
                draw_info.max_delta = delta;
            } else if delta < draw_info.min_delta {
                draw_info.min_delta = delta;
            }

            let x = split_time.total_seconds() as f32 * draw_info.scale_factor_x.unwrap_or(0.0);

            let is_best_segment =
                show_best_segments && analysis::check_best_segment(timer, i, timing_method);

            draw_info.points.push(Point {
                x,
                y: delta, // Not the final value of y.
                is_best_segment,
            });
        };
    }
}
/// Calculates the points' x-coordinates and their deltas, which determine their
/// y-coordinates. The deltas are stored as the points' y-coordinates and will
/// have to be corrected before rendering.
Calculates the points' x-coordinates and their deltas, which determine their
y-coordinates. The deltas are stored as the points' y-coordinates and will
have to be corrected before rendering.
Calculates the points ' x - coordinates and their deltas which determine their y - coordinates . The deltas are stored as the points ' y - coordinates and will have to be corrected before rendering .
fn calculate_split_points(
    timer: &Timer,
    draw_info: &mut DrawInfo,
    comparison: &str,
    show_best_segments: bool,
) {
    let timing_method = timer.current_timing_method();
    for (i, segment) in timer.run().segments()[..draw_info.split_index]
        .iter()
        .enumerate()
    {
        catch! {
            let split_time = segment.split_time()[timing_method]?;
            let comparison_time = segment.comparison(comparison)[timing_method]?;
            let delta = (split_time - comparison_time).total_seconds() as f32;
            if delta > draw_info.max_delta {
                draw_info.max_delta = delta;
            } else if delta < draw_info.min_delta {
                draw_info.min_delta = delta;
            }
            let x = split_time.total_seconds() as f32 * draw_info.scale_factor_x.unwrap_or(0.0);
            let is_best_segment =
                show_best_segments && analysis::check_best_segment(timer, i, timing_method);
            draw_info.points.push(Point {
                x,
                y: delta, // Not the final value of y.
                is_best_segment,
            });
        };
    }
}
fn calculate_split_points ( timer : & Timer , draw_info : & mut DrawInfo , comparison : & str , show_best_segments : bool , ) { let timing_method = timer . current_timing_method ( ) ; for ( i , segment ) in timer . run ( ) . segments ( ) [ .. draw_info . split_index ] . iter ( ) . enumerate ( ) { catch ! { let split_time segment split_time ( ) [ timing_method ] let comparison_time segment comparison ( comparison ) [ timing_method ] let delta ( split_time comparison_time ) total_seconds ( ) as f32 if delta draw_info max_delta { draw_info max_delta delta } else if delta draw_info min_delta { draw_info min_delta delta } let x split_time total_seconds ( ) as f32 draw_info scale_factor_x unwrap_or ( 0.0 ) let is_best_segment show_best_segments analysis check_best_segment ( timer i timing_method ) draw_info points push ( Point { x y delta // Not the final value of y. is_best_segment } ) } ; } }
Calculates the points' x-coordinates and their deltas, which determine their
y-coordinates.
Calculates the points ' x - coordinates and their deltas which determine their y - coordinates .
timer
&Timer
draw_info
&mut DrawInfo
comparison
&str
show_best_segments
bool
timer
&Timer
draw_info
&mut DrawInfo
comparison
&str
show_best_segments
bool