[Refactor] Move the seconds_to_degrees function to the svg_clock module
This commit is contained in:
parent
eb99194e16
commit
4c15ffa826
@ -18,8 +18,8 @@ use svg::Document;
|
||||
mod svg_clock;
|
||||
|
||||
use svg_clock::{
|
||||
cache_hour_name_paths, hour_marker, svg_to_usvg, HOUR_NAMES, HOUR_NAME_FONT_SIZE, IMAGE_WIDTH,
|
||||
OUTER_R, RING_WIDTH, UTC_HOUR_FONT_SIZE,
|
||||
cache_hour_name_paths, hour_marker, seconds_to_degrees, svg_to_usvg, HOUR_NAMES,
|
||||
HOUR_NAME_FONT_SIZE, IMAGE_WIDTH, OUTER_R, RING_WIDTH, UTC_HOUR_FONT_SIZE,
|
||||
};
|
||||
|
||||
sctk::default_environment!(SeasonalClock, desktop);
|
||||
@ -36,10 +36,6 @@ struct CompleteConfig {
|
||||
seasonal_clock: Config,
|
||||
}
|
||||
|
||||
fn seconds_to_degrees(seconds: i32) -> f32 {
|
||||
seconds as f32 * 360.0 / 86400.0
|
||||
}
|
||||
|
||||
fn get_range_path(radius: f32, range_name: &str, start_time: i32, end_time: i32) -> Path {
|
||||
let start_deg = seconds_to_degrees(start_time);
|
||||
let end_deg = seconds_to_degrees(end_time);
|
||||
|
@ -43,6 +43,10 @@ impl fmt::Display for Season {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn seconds_to_degrees(seconds: i32) -> f32 {
|
||||
seconds as f32 * 360.0 / 86400.0
|
||||
}
|
||||
|
||||
pub fn svg_to_usvg(document: Document) -> Tree {
|
||||
let doc_str = document.to_string();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user