1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:37:35 +00:00

Presenter: Provide default text styles to text objects

Having an uninitialized text alignment value caused a crash in
Gfx::Painter::draw_text.
This commit is contained in:
Arda Cinar 2022-12-13 21:16:10 +03:00 committed by Tim Flynn
parent 9d9a6b6b64
commit 3ea1584f2e

View file

@ -59,7 +59,8 @@ public:
protected: protected:
GraphicsObject(); GraphicsObject();
Gfx::Color m_color; // FIXME: Change the default color based on the color scheme
Gfx::Color m_color { Gfx::Color::Black };
}; };
class Text : public GraphicsObject { class Text : public GraphicsObject {
@ -86,9 +87,9 @@ protected:
DeprecatedString m_text; DeprecatedString m_text;
// The font family, technically speaking. // The font family, technically speaking.
DeprecatedString m_font; DeprecatedString m_font;
int m_font_size; int m_font_size { 18 };
unsigned m_font_weight; unsigned m_font_weight { Gfx::FontWeight::Regular };
Gfx::TextAlignment m_text_alignment; Gfx::TextAlignment m_text_alignment { Gfx::TextAlignment::CenterLeft };
}; };
// How to scale an image object. // How to scale an image object.