Minor tweaks to drawn text positions

This commit is contained in:
Stephen Seo 2021-09-17 15:05:32 +09:00
parent fefffd6f88
commit 1d4a6d5f35

View file

@ -683,7 +683,7 @@ async fn main() -> Result<(), String> {
} }
draw_rectangle( draw_rectangle(
TITLE_X_OFFSET, TITLE_X_OFFSET,
prev_height - TITLE_Y_OFFSET - text_dim.height * 2.0, prev_height - TITLE_Y_OFFSET - text_dim.height,
text_dim.width, text_dim.width,
text_dim.height, text_dim.height,
Color::new(0.0, 0.0, 0.0, 0.4), Color::new(0.0, 0.0, 0.0, 0.4),
@ -691,7 +691,7 @@ async fn main() -> Result<(), String> {
draw_text( draw_text(
&title, &title,
TITLE_X_OFFSET, TITLE_X_OFFSET,
prev_height - TITLE_Y_OFFSET - text_dim.height, prev_height - TITLE_Y_OFFSET,
*filename_font_size.as_ref().unwrap() as f32, *filename_font_size.as_ref().unwrap() as f32,
WHITE, WHITE,
); );
@ -700,11 +700,7 @@ async fn main() -> Result<(), String> {
let timer_dim = measure_text(&timer_string, None, 64, 1.0f32); let timer_dim = measure_text(&timer_string, None, 64, 1.0f32);
draw_rectangle( draw_rectangle(
TIMER_X_OFFSET, TIMER_X_OFFSET,
prev_height prev_height - TITLE_Y_OFFSET - text_dim.height - TIMER_Y_OFFSET - timer_dim.height,
- TITLE_Y_OFFSET
- text_dim.height
- TIMER_Y_OFFSET
- timer_dim.height * 2.0,
timer_dim.width, timer_dim.width,
timer_dim.height, timer_dim.height,
Color::new(0.0, 0.0, 0.0, 0.4), Color::new(0.0, 0.0, 0.0, 0.4),
@ -712,7 +708,7 @@ async fn main() -> Result<(), String> {
draw_text( draw_text(
&timer_string, &timer_string,
TIMER_X_OFFSET, TIMER_X_OFFSET,
prev_height - TITLE_Y_OFFSET - text_dim.height - TIMER_Y_OFFSET - timer_dim.height, prev_height - TITLE_Y_OFFSET - text_dim.height - TIMER_Y_OFFSET,
64.0f32, 64.0f32,
WHITE, WHITE,
); );