summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorGilles Roudiere <gilles.roudiere@gmail.com>2018-03-18 22:33:17 +0100
committerGilles Roudiere <gilles.roudiere@gmail.com>2018-03-18 22:33:17 +0100
commit896e5a64d39e4dd477d961c5c78b480910fb6b09 (patch)
tree4dcbb5d6d5f1a68c39416efe5bd7179bfa345866 /scene/gui
parent395ecc2235f91654ef7c06c7e73aabb352bb17fb (diff)
Fixes wrong calculation of gridcontainer's children size
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/grid_container.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/grid_container.cpp b/scene/gui/grid_container.cpp
index 9948672097..b401abd436 100644
--- a/scene/gui/grid_container.cpp
+++ b/scene/gui/grid_container.cpp
@@ -84,8 +84,8 @@ void GridContainer::_notification(int p_what) {
if (!row_expanded.has(E->key()))
remaining_space.height -= E->get();
}
- remaining_space.height -= vsep * (max_row - 1);
- remaining_space.width -= hsep * (max_col - 1);
+ remaining_space.height -= vsep * MAX(max_row - 1, 0);
+ remaining_space.width -= hsep * MAX(max_col - 1, 0);
bool can_fit = false;
while (!can_fit && col_expanded.size() > 0) {