From 6e7c3804f4a96285031a2c93a0ab3dc9045d7cf0 Mon Sep 17 00:00:00 2001 From: Piyush Mishra Date: Fri, 14 Jan 2022 21:27:10 +0530 Subject: [PATCH] fix: text used to leave some space on top --- src/utils.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/utils.rs b/src/utils.rs index 8c5de69..9b84c35 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -258,9 +258,8 @@ fn draw_layer_and_text( tmp, image::Rgba([255, 255, 255, 255]), ((width - text_width) / 2.0) as u32, - ((quote_position * height) / original_height - + (text_height / 2.0) - + index as f64 * (text_height * 1.2)) as u32, + ((quote_position * height) / original_height + index as f64 * (text_height * 1.2)) + as u32, rusttype::Scale::uniform(size as f32), &globals::FONT_QUOTE, line, @@ -279,9 +278,7 @@ fn draw_layer_and_text( tmp, image::Rgba([255, 255, 255, 255]), (width * 0.99 - text_width) as u32, - ((tag_position * height) / original_height - + (text_height / 2.0) - + index as f64 * (text_height * 1.2)) as u32, + ((tag_position * height) / original_height + index as f64 * (text_height * 1.2)) as u32, rusttype::Scale::uniform(size as f32), &globals::FONT_TAG, line,