diff --git a/Cargo.lock b/Cargo.lock index ed7865c..2a8a0b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1427,7 +1427,7 @@ dependencies = [ [[package]] name = "mpd_info_screen" -version = "0.2.10" +version = "0.2.11" dependencies = [ "ggez", "image", diff --git a/Cargo.toml b/Cargo.toml index b7263fd..ac99307 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mpd_info_screen" -version = "0.2.10" +version = "0.2.11" edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/README.md b/README.md index c787ddb..10db2cc 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ counter, and the filename currently being played # Usage - mpd_info_screen 0.2.10 + mpd_info_screen 0.2.11 USAGE: mpd_info_screen [FLAGS] [OPTIONS] [port] diff --git a/src/display.rs b/src/display.rs index 594d998..c611017 100644 --- a/src/display.rs +++ b/src/display.rs @@ -23,6 +23,8 @@ 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; +const INCREASE_AMT: f32 = 6.0 / 5.0; +const DECREASE_AMT: f32 = 5.0 / 6.0; fn seconds_to_time(seconds: f64) -> String { let seconds_int: u64 = seconds.floor() as u64; @@ -276,12 +278,12 @@ impl MPDDisplay { text_height_limit }) { - current_x = current_x * 4.0f32 / 5.0f32; - current_y = current_y * 4.0f32 / 5.0f32; + current_x = current_x * DECREASE_AMT; + current_y = current_y * DECREASE_AMT; continue; } 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; + current_x = current_x * INCREASE_AMT; + current_y = current_y * INCREASE_AMT; continue; } else { break;