diff --git a/src/main.rs b/src/main.rs index 8b4acf4..96cd372 100644 --- a/src/main.rs +++ b/src/main.rs @@ -40,14 +40,9 @@ fn seconds_to_degrees(seconds: i32) -> f32 { seconds as f32 * 360.0 / 86400.0 } -fn time_to_degrees(timestamp: i32, // should be time/timestamp -) -> f32 { - seconds_to_degrees(timestamp) -} - fn get_range_path(radius: f32, range_name: &str, start_time: i32, end_time: i32) -> Path { - let start_deg = time_to_degrees(start_time); - let end_deg = time_to_degrees(end_time); + let start_deg = seconds_to_degrees(start_time); + let end_deg = seconds_to_degrees(end_time); let deg_diff = end_deg - start_deg; let start_delta_x = radius * start_deg.to_radians().sin(); @@ -275,7 +270,7 @@ fn gen_svg(config: &Option, hour_name_path_cache: &[(PathData, PathData) "transform", format!( "rotate({}, {}, {})", - time_to_degrees(local_time) - utc_rotation, + seconds_to_degrees(local_time) - utc_rotation, IMAGE_WIDTH / 2, IMAGE_WIDTH / 2 ), @@ -302,7 +297,7 @@ fn gen_svg(config: &Option, hour_name_path_cache: &[(PathData, PathData) "transform", format!( "rotate({}, {}, {})", - time_to_degrees(noon), + seconds_to_degrees(noon), IMAGE_WIDTH / 2, IMAGE_WIDTH / 2 ), @@ -321,7 +316,7 @@ fn gen_svg(config: &Option, hour_name_path_cache: &[(PathData, PathData) "transform", format!( "rotate({}, {}, {})", - time_to_degrees(midnight), + seconds_to_degrees(midnight), IMAGE_WIDTH / 2, IMAGE_WIDTH / 2 ), @@ -377,7 +372,7 @@ fn gen_svg(config: &Option, hour_name_path_cache: &[(PathData, PathData) "transform", format!( "rotate({}, {}, {})", - time_to_degrees(local_time), + seconds_to_degrees(local_time), IMAGE_WIDTH / 2, IMAGE_WIDTH / 2 ),