Introduce text::Alignment with Justified support

This commit is contained in:
Héctor Ramón Jiménez 2025-03-11 02:25:44 +01:00
parent e45d4b5cb6
commit 0e4a392731
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
30 changed files with 227 additions and 195 deletions

View file

@ -170,8 +170,8 @@ impl Theme {
});
let mut text = canvas::Text {
horizontal_alignment: alignment::Horizontal::Center,
vertical_alignment: alignment::Vertical::Top,
align_x: alignment::Horizontal::Center,
align_y: alignment::Vertical::Top,
size: Pixels(15.0),
color: text_color,
..canvas::Text::default()
@ -214,7 +214,7 @@ impl Theme {
});
}
text.vertical_alignment = alignment::Vertical::Bottom;
text.align_y = alignment::Vertical::Bottom;
let hsl = Hsl::from_color(Rgb::from(self.base));
for i in 0..self.len() {