From 3ea1584f2eafc9988bade98cb605ff72c7bcf3e1 Mon Sep 17 00:00:00 2001 From: Arda Cinar Date: Tue, 13 Dec 2022 21:16:10 +0300 Subject: [PATCH] Presenter: Provide default text styles to text objects Having an uninitialized text alignment value caused a crash in Gfx::Painter::draw_text. --- Userland/Applications/Presenter/SlideObject.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Userland/Applications/Presenter/SlideObject.h b/Userland/Applications/Presenter/SlideObject.h index c41202aa9f..a36bde85e0 100644 --- a/Userland/Applications/Presenter/SlideObject.h +++ b/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.