Преглед изворни кода

Presenter: Provide default text styles to text objects

Having an uninitialized text alignment value caused a crash in
Gfx::Painter::draw_text.
Arda Cinar пре 2 година
родитељ
комит
3ea1584f2e
1 измењених фајлова са 5 додато и 4 уклоњено
  1. 5 4
      Userland/Applications/Presenter/SlideObject.h

+ 5 - 4
Userland/Applications/Presenter/SlideObject.h

@@ -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.