diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-04-28 23:10:06 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-04-28 23:10:06 -0300 |
commit | 7773d70f449ae8dd66691661fe3ed86d1cabf219 (patch) | |
tree | b5134ed07b7d24c25dd2fe9e9b251ddd23f203ee | |
parent | fa83cf3c962f182db9d953ee4af38e8bb6bdb0ef (diff) |
bad lookup in grid container corrected, cells are properly aligned again. Fixes #1462
-rw-r--r-- | scene/gui/grid_container.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/scene/gui/grid_container.cpp b/scene/gui/grid_container.cpp index 2959513799..214d874675 100644 --- a/scene/gui/grid_container.cpp +++ b/scene/gui/grid_container.cpp @@ -69,6 +69,7 @@ void GridContainer::_notification(int p_what) { else row_minh[row]=ms.height; + // print_line("store row "+itos(row)+" mw "+itos(ms.height)); if (c->get_h_size_flags()&SIZE_EXPAND) col_expanded.insert(col); @@ -121,23 +122,22 @@ void GridContainer::_notification(int p_what) { row_ofs+=row_minh[row-1]+sep+(row_expanded.has(row-1)?row_expand:0); } - if (c->is_visible()) { - Size2 s; - if (col_minw.has(col)) - s.width=col_minw[col]; - if (row_minh.has(row)) - s.height=row_minh[col]; - - if (row_expanded.has(row)) - s.height+=row_expand; - if (col_expanded.has(col)) - s.width+=col_expand; + Size2 s; + if (col_minw.has(col)) + s.width=col_minw[col]; + if (row_minh.has(row)) + s.height=row_minh[row]; - Point2 p(col_ofs,row_ofs); + if (row_expanded.has(row)) + s.height+=row_expand; + if (col_expanded.has(col)) + s.width+=col_expand; - fit_child_in_rect(c,Rect2(p,s)); + Point2 p(col_ofs,row_ofs); - } +// print_line("col: "+itos(col)+" row: "+itos(row)+" col_ofs: "+itos(col_ofs)+" row_ofs: "+itos(row_ofs)); + fit_child_in_rect(c,Rect2(p,s)); + //print_line("col: "+itos(col)+" row: "+itos(row)+" rect: "+Rect2(p,s)); if (col_minw.has(col)) { col_ofs+=col_minw[col]+sep+(col_expanded.has(col)?col_expand:0); |