]> git.seodisparate.com - mpd_info_screen/commitdiff
Minor tweaks to drawn text positions
authorStephen Seo <seo.disparate@gmail.com>
Fri, 17 Sep 2021 06:05:32 +0000 (15:05 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Fri, 17 Sep 2021 06:05:32 +0000 (15:05 +0900)
src/main.rs

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