]> git.seodisparate.com - mpd_info_screen/commitdiff
Replace magic number with const, bump version 0.2.10
authorStephen Seo <seo.disparate@gmail.com>
Mon, 10 Jan 2022 12:37:43 +0000 (21:37 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Mon, 10 Jan 2022 12:37:43 +0000 (21:37 +0900)
Cargo.lock
Cargo.toml
README.md
src/display.rs

index 38f9046741ddc4c4fa6ef64dbb756048b7bf0208..ed7865cacca927fd32a6c349a62d44b2d7a950f2 100644 (file)
@@ -1427,7 +1427,7 @@ dependencies = [
 
 [[package]]
 name = "mpd_info_screen"
-version = "0.2.9"
+version = "0.2.10"
 dependencies = [
  "ggez",
  "image",
index 970e91381c206b9f38204d89d53706713c0edae4..b7263fde7644eb20ed4b2f3408f089cb063e8556 100644 (file)
@@ -1,6 +1,6 @@
 [package]
 name = "mpd_info_screen"
-version = "0.2.9"
+version = "0.2.10"
 edition = "2018"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
index ae804473d7a59ecbb37fabaa47910d8bbef196cd..c787ddbd89e1aca6149c3c279defb1a6644b3052 100644 (file)
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ counter, and the filename currently being played
 
 # Usage
 
-    mpd_info_screen 0.2.9
+    mpd_info_screen 0.2.10
     
     USAGE:
         mpd_info_screen [FLAGS] [OPTIONS] <host> [port]
index be9888726c65e5e88ce4b80e9988792a0718fa0b..594d998fd16e08bb57f769586f042cc7ff94ace1 100644 (file)
@@ -22,6 +22,7 @@ const TEXT_OFFSET_Y_SPACING: f32 = 0.4;
 const TEXT_HEIGHT_SCALE: f32 = 0.1;
 const ARTIST_HEIGHT_SCALE: f32 = 0.08;
 const TIMER_HEIGHT_SCALE: f32 = 0.07;
+const MIN_WIDTH_RATIO: f32 = 4.0 / 5.0;
 
 fn seconds_to_time(seconds: f64) -> String {
     let seconds_int: u64 = seconds.floor() as u64;
@@ -278,7 +279,7 @@ impl MPDDisplay {
                         current_x = current_x * 4.0f32 / 5.0f32;
                         current_y = current_y * 4.0f32 / 5.0f32;
                         continue;
-                    } else if screen_coords.w * 2.0 / 3.0 > width {
+                    } else if screen_coords.w * MIN_WIDTH_RATIO > width {
                         current_x = current_x * 5.0f32 / 4.0f32;
                         current_y = current_y * 5.0f32 / 4.0f32;
                         continue;