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:
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user