From 7f953a5f40a6175cd85fcc8f1ee44d24bf2a4d47 Mon Sep 17 00:00:00 2001 From: hippoz <10706925-hippoz@users.noreply.gitlab.com> Date: Wed, 30 Mar 2022 16:12:25 +0300 Subject: [PATCH] make lables text left-aligned --- src/Label.cpp | 2 +- src/Painter.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Label.cpp b/src/Label.cpp index dbd7254..52fb983 100644 --- a/src/Label.cpp +++ b/src/Label.cpp @@ -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(); } diff --git a/src/Painter.cpp b/src/Painter.cpp index e4265f1..4ee4824 100644 --- a/src/Painter.cpp +++ b/src/Painter.cpp @@ -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);