mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 06:28:13 +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:
parent
9d9a6b6b64
commit
3ea1584f2e
1 changed files with 5 additions and 4 deletions
|
@ -59,7 +59,8 @@ public:
|
|||
protected:
|
||||
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 {
|
||||
|
@ -86,9 +87,9 @@ protected:
|
|||
DeprecatedString m_text;
|
||||
// The font family, technically speaking.
|
||||
DeprecatedString m_font;
|
||||
int m_font_size;
|
||||
unsigned m_font_weight;
|
||||
Gfx::TextAlignment m_text_alignment;
|
||||
int m_font_size { 18 };
|
||||
unsigned m_font_weight { Gfx::FontWeight::Regular };
|
||||
Gfx::TextAlignment m_text_alignment { Gfx::TextAlignment::CenterLeft };
|
||||
};
|
||||
|
||||
// How to scale an image object.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue