From c38808b5b1b838c075ded22c490a37dfef3b0ce9 Mon Sep 17 00:00:00 2001 From: Zher Huei Lee Date: Thu, 24 Sep 2015 14:04:15 +0100 Subject: added alignment to BoxContainer Allows aligning contents of VBoxContainer and HBoxcontainer without having to insert expanding spacers. --- scene/gui/box_container.cpp | 36 ++++++++++++++++++++++++++++++++++++ scene/gui/box_container.h | 17 +++++++++++++++++ 2 files changed, 53 insertions(+) (limited to 'scene') diff --git a/scene/gui/box_container.cpp b/scene/gui/box_container.cpp index 6489cbccd5..b63b3de530 100644 --- a/scene/gui/box_container.cpp +++ b/scene/gui/box_container.cpp @@ -99,8 +99,10 @@ void BoxContainer::_resort() { elements exist */ + bool has_stretched = false; while(stretch_ratio_total>0) { // first of all, dont even be here if no stretchable objects exist + has_stretched = true; bool refit_successful=true; //assume refit-test will go well for(int i=0;i