Replace magic number with const, bump version

This commit is contained in:
Stephen Seo 2022-01-10 21:37:43 +09:00
parent 231db34338
commit b42aaeb35a
4 changed files with 5 additions and 4 deletions

2
Cargo.lock generated
View file

@ -1427,7 +1427,7 @@ dependencies = [
[[package]]
name = "mpd_info_screen"
version = "0.2.9"
version = "0.2.10"
dependencies = [
"ggez",
"image",

View 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

View file

@ -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]

View 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;