Fix use of unitialized variables

The second in my quest to make Godot 3.x compile with -Werror on GCC7
This commit is contained in:
Hein-Pieter van Braam
2017-09-01 22:33:39 +02:00
parent dac150108a
commit 9c63ab99f0
38 changed files with 129 additions and 86 deletions

View File

@ -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);
}