make lables text left-aligned

This commit is contained in:
hippoz 2022-03-30 16:12:25 +03:00
parent 4401b7b5b2
commit 7f953a5f40
Signed by: hippoz
GPG key ID: 7C52899193467641
2 changed files with 2 additions and 2 deletions

View file

@ -19,7 +19,7 @@ void Label::on_paint() {
painter.source_rgb(text_color);
painter.set_pango_font_description(get_styles()->get_controls_font_description());
painter.text(get_current_geometry(), m_text, PaintTextAlign::Center, PANGO_ELLIPSIZE_NONE);
painter.text(get_current_geometry(), m_text, PaintTextAlign::Left, PANGO_ELLIPSIZE_NONE);
painter.fill();
}

View file

@ -62,7 +62,7 @@ bool Painter::text(Box &geometry, std::string &text, PaintTextAlign align, Pango
if (align == PaintTextAlign::Center) {
x = geometry.get_x() + ((geometry.get_width() - font_width) / 2);
} else {
x = 0;
x = geometry.get_x();
}
m_cairo->move_to(x, y);