From 42c3bd3068fea85e383accca7adb1dfe97c5ef1d Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Tue, 28 Apr 2026 09:33:12 -0500 Subject: [PATCH] [fix]: Text not being centered when using center alignment --- src/ui/text_svg.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/text_svg.rs b/src/ui/text_svg.rs index 9dfdedc..e827701 100644 --- a/src/ui/text_svg.rs +++ b/src/ui/text_svg.rs @@ -330,7 +330,7 @@ impl TextSvg { let position = half_lines.mul_add( -text_and_line_spacing, middle_position, - ); + ) + text_and_line_spacing / 2.0; ("start", position, "10") } TextAlignment::MiddleCenter => { @@ -338,7 +338,7 @@ impl TextSvg { let position = half_lines.mul_add( -text_and_line_spacing, middle_position, - ); + ) + text_and_line_spacing / 2.0; ("middle", position, center_y.as_str()) } TextAlignment::MiddleRight => { @@ -346,7 +346,7 @@ impl TextSvg { let position = half_lines.mul_add( -text_and_line_spacing, middle_position, - ); + ) + text_and_line_spacing / 2.0; ("end", position, x_width_padded.as_str()) } TextAlignment::BottomLeft => {