diff options
Diffstat (limited to 'scene/resources/font.cpp')
-rw-r--r-- | scene/resources/font.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index d9ccd31f88..ea75748b3d 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -40,7 +40,7 @@ void Font::draw_halign(RID p_canvas_item, const Point2 &p_pos, HAlign p_align, f return; } - float ofs; + float ofs = 0.f; switch (p_align) { case HALIGN_LEFT: { ofs = 0; @@ -51,6 +51,9 @@ void Font::draw_halign(RID p_canvas_item, const Point2 &p_pos, HAlign p_align, f case HALIGN_RIGHT: { ofs = p_width - length; } break; + default: { + ERR_PRINT("Unknown halignment type"); + } break; } draw(p_canvas_item, p_pos + Point2(ofs, 0), p_text, p_modulate, p_width); } |