[fix]: Text not being centered when using center alignment
This commit is contained in:
parent
495a28180f
commit
42c3bd3068
1 changed files with 3 additions and 3 deletions
|
|
@ -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 => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue