diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-06-09 22:16:13 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-06-09 22:16:13 -0300 |
commit | 6b7ddce183b7ba1e05739a345bf8b100b11e02ca (patch) | |
tree | 52bc36bc55a0a26ba7243bea18a7f3b1d6dfbe0e /scene/gui | |
parent | 678563a3b9352655acdb298342e1a1b47e02c976 (diff) |
Fix last line of label being deleted by line spacing
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/label.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index 8652aab649..2d4438c48c 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -92,7 +92,9 @@ void Label::_notification(int p_what) { VisualServer::get_singleton()->canvas_item_set_distance_field_mode(get_canvas_item(),font.is_valid() && font->is_distance_field_hint()); int font_h = font->get_height()+line_spacing; - int lines_visible = size.y/font_h; + + int lines_visible = (size.y+line_spacing)/font_h; + int space_w=font->get_char_size(' ').width; int chars_total=0; |