Minor refactorings
This commit is contained in:
parent
92f2a441a4
commit
76372e4f97
1 changed files with 10 additions and 14 deletions
24
src/main.rs
24
src/main.rs
|
@ -928,14 +928,12 @@ async fn main() -> Result<(), String> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let temp_dim_opt = artist_dim_opt.as_ref().unwrap();
|
||||||
draw_rectangle(
|
draw_rectangle(
|
||||||
TEXT_X_OFFSET,
|
TEXT_X_OFFSET,
|
||||||
prev_height
|
prev_height - temp_offset_y - TEXT_Y_OFFSET - temp_dim_opt.height,
|
||||||
- temp_offset_y
|
temp_dim_opt.width,
|
||||||
- TEXT_Y_OFFSET
|
temp_dim_opt.height,
|
||||||
- artist_dim_opt.as_ref().unwrap().height,
|
|
||||||
artist_dim_opt.as_ref().unwrap().width,
|
|
||||||
artist_dim_opt.as_ref().unwrap().height,
|
|
||||||
Color::new(0.0, 0.0, 0.0, 0.4),
|
Color::new(0.0, 0.0, 0.0, 0.4),
|
||||||
);
|
);
|
||||||
draw_text(
|
draw_text(
|
||||||
|
@ -946,18 +944,16 @@ async fn main() -> Result<(), String> {
|
||||||
WHITE,
|
WHITE,
|
||||||
);
|
);
|
||||||
|
|
||||||
temp_offset_y += TEXT_Y_OFFSET + artist_dim_opt.as_ref().unwrap().height;
|
temp_offset_y += TEXT_Y_OFFSET + temp_dim_opt.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
if !title.is_empty() && !opt.disable_show_title {
|
if !title.is_empty() && !opt.disable_show_title {
|
||||||
|
let temp_dim_opt = title_dim_opt.as_ref().unwrap();
|
||||||
draw_rectangle(
|
draw_rectangle(
|
||||||
TEXT_X_OFFSET,
|
TEXT_X_OFFSET,
|
||||||
prev_height
|
prev_height - temp_offset_y - TEXT_Y_OFFSET - temp_dim_opt.height,
|
||||||
- temp_offset_y
|
temp_dim_opt.width,
|
||||||
- TEXT_Y_OFFSET
|
temp_dim_opt.height,
|
||||||
- title_dim_opt.as_ref().unwrap().height,
|
|
||||||
title_dim_opt.as_ref().unwrap().width,
|
|
||||||
title_dim_opt.as_ref().unwrap().height,
|
|
||||||
Color::new(0.0, 0.0, 0.0, 0.4),
|
Color::new(0.0, 0.0, 0.0, 0.4),
|
||||||
);
|
);
|
||||||
draw_text(
|
draw_text(
|
||||||
|
@ -968,7 +964,7 @@ async fn main() -> Result<(), String> {
|
||||||
WHITE,
|
WHITE,
|
||||||
);
|
);
|
||||||
|
|
||||||
temp_offset_y += TEXT_Y_OFFSET + title_dim_opt.as_ref().unwrap().height;
|
temp_offset_y += TEXT_Y_OFFSET + temp_dim_opt.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
let timer_string = seconds_to_time(track_timer);
|
let timer_string = seconds_to_time(track_timer);
|
||||||
|
|
Loading…
Reference in a new issue