summaryrefslogtreecommitdiff
path: root/scene/gui/label.cpp
diff options
context:
space:
mode:
authorvolzhs <volzhs@gmail.com>2016-06-06 00:09:02 +0900
committervolzhs <volzhs@gmail.com>2016-06-06 00:09:02 +0900
commitf792f63b030ad2306c0407492f03fd9508b70766 (patch)
tree7309ecd5d4cbedfb54b7531753ab427691de79fd /scene/gui/label.cpp
parent64fd75d91a65d6fe05cf6c3578f53f85b4c92c27 (diff)
Fix min size bug of Label
caused by #5030
Diffstat (limited to 'scene/gui/label.cpp')
-rw-r--r--scene/gui/label.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp
index 8652aab649..09c6a77b42 100644
--- a/scene/gui/label.cpp
+++ b/scene/gui/label.cpp
@@ -488,9 +488,9 @@ void Label::regenerate_word_cache() {
if (!autowrap) {
minsize.width=width;
if (max_lines_visible > 0 && line_count > max_lines_visible) {
- minsize.height=(font->get_height() * max_lines_visible) + (line_spacing * (max_lines_visible - 1));
+ minsize.height=(font->get_height()+line_spacing)*max_lines_visible;
} else {
- minsize.height=(font->get_height() * line_count)+(line_spacing * (line_count - 1));
+ minsize.height=(font->get_height()+line_spacing)*line_count;
}
}