fix: text used to leave some space on top

This commit is contained in:
Piyush मिश्रः 2022-01-14 21:27:10 +05:30
parent b7a469ee02
commit 6e7c3804f4
1 changed files with 3 additions and 6 deletions

View File

@ -258,9 +258,8 @@ fn draw_layer_and_text(
tmp, tmp,
image::Rgba([255, 255, 255, 255]), image::Rgba([255, 255, 255, 255]),
((width - text_width) / 2.0) as u32, ((width - text_width) / 2.0) as u32,
((quote_position * height) / original_height ((quote_position * height) / original_height + index as f64 * (text_height * 1.2))
+ (text_height / 2.0) as u32,
+ index as f64 * (text_height * 1.2)) as u32,
rusttype::Scale::uniform(size as f32), rusttype::Scale::uniform(size as f32),
&globals::FONT_QUOTE, &globals::FONT_QUOTE,
line, line,
@ -279,9 +278,7 @@ fn draw_layer_and_text(
tmp, tmp,
image::Rgba([255, 255, 255, 255]), image::Rgba([255, 255, 255, 255]),
(width * 0.99 - text_width) as u32, (width * 0.99 - text_width) as u32,
((tag_position * height) / original_height ((tag_position * height) / original_height + index as f64 * (text_height * 1.2)) as u32,
+ (text_height / 2.0)
+ index as f64 * (text_height * 1.2)) as u32,
rusttype::Scale::uniform(size as f32), rusttype::Scale::uniform(size as f32),
&globals::FONT_TAG, &globals::FONT_TAG,
line, line,