diff --git a/src/modes/chrono.rs b/src/modes/chrono.rs index 80a09fe..372e9b6 100644 --- a/src/modes/chrono.rs +++ b/src/modes/chrono.rs @@ -195,13 +195,10 @@ fn render_frame( // Display pause state if chronometer.is_paused() { let text = "[PAUSE]"; - let x = width / 2 - (text.len() as i16) / 2; - rendering::draw_text( - text, - x, - y - symbols::SYMBOL_HEIGHT as i16 - symbols::SYMBOL_HEIGHT as i16 / 2, - color, - )?; + let x = width / 2 - (text.len() as i16) / 2 - 1; + let y = y - symbols::SYMBOL_HEIGHT as i16 + symbols::SYMBOL_HEIGHT as i16 / 2 + 1; + + rendering::draw_text(text, x, y, color)?; } return Ok(()); diff --git a/src/modes/timer.rs b/src/modes/timer.rs index fb458ed..48fbeb8 100644 --- a/src/modes/timer.rs +++ b/src/modes/timer.rs @@ -126,31 +126,24 @@ fn render_frame(config: &Config, timer: &Timer) -> io::Result<()> { let remaining = utils::format_duration(timer.time_left()); rendering::draw_time(&remaining, color)?; - // Display pause state let (width, height) = rendering::get_terminal_size()?; let y = height / 2 + symbols::SYMBOL_HEIGHT as i16 / 2 + 2; - if timer.is_paused() { - let text = "[PAUSE]"; - let x = width / 2 - (text.len() as i16) / 2; - rendering::draw_text( - text, - x, - y - symbols::SYMBOL_HEIGHT as i16 - symbols::SYMBOL_HEIGHT as i16 / 2, - color, - )?; - } // Display finish state - else if timer.is_finished() { + if timer.is_finished() { let text = "[FINISHED]"; - let x = width / 2 - (text.len() as i16) / 2; + let x = width / 2 - (text.len() as i16) / 2 - 1; + let y = y - symbols::SYMBOL_HEIGHT as i16 + symbols::SYMBOL_HEIGHT as i16 / 2 + 1; - rendering::draw_text( - text, - x, - y - symbols::SYMBOL_HEIGHT as i16 - symbols::SYMBOL_HEIGHT as i16 / 2, - color, - )?; + rendering::draw_text(text, x, y, color)?; + } + // Display pause state + else if timer.is_paused() { + let text = "[PAUSE]"; + let x = width / 2 - (text.len() as i16) / 2 - 1; + let y = y - symbols::SYMBOL_HEIGHT as i16 + symbols::SYMBOL_HEIGHT as i16 / 2 + 1; + + rendering::draw_text(text, x, y, color)?; } return Ok(());