Просмотр исходного кода

Optimal layout size with layout containing only fixed space is now properly calculated

Marko Pintera 11 лет назад
Родитель
Сommit
69adb41575
2 измененных файлов с 6 добавлено и 0 удалено
  1. 3 0
      BansheeEngine/Source/BsGUILayoutX.cpp
  2. 3 0
      BansheeEngine/Source/BsGUILayoutY.cpp

+ 3 - 0
BansheeEngine/Source/BsGUILayoutX.cpp

@@ -19,6 +19,9 @@ namespace BansheeEngine
 		{
 		{
 			Vector2I optimalSize = child->_calculateOptimalLayoutSize();
 			Vector2I optimalSize = child->_calculateOptimalLayoutSize();
 
 
+			if (child->_getType() == GUIElementBase::Type::FixedSpace)
+				optimalSize.y = 0;
+
 			UINT32 paddingX = child->_getPadding().left + child->_getPadding().right;
 			UINT32 paddingX = child->_getPadding().left + child->_getPadding().right;
 			UINT32 paddingY = child->_getPadding().top + child->_getPadding().bottom;
 			UINT32 paddingY = child->_getPadding().top + child->_getPadding().bottom;
 
 

+ 3 - 0
BansheeEngine/Source/BsGUILayoutY.cpp

@@ -19,6 +19,9 @@ namespace BansheeEngine
 		{
 		{
 			Vector2I optimalSize = child->_calculateOptimalLayoutSize();
 			Vector2I optimalSize = child->_calculateOptimalLayoutSize();
 			
 			
+			if (child->_getType() == GUIElementBase::Type::FixedSpace)
+				optimalSize.x = 0;
+
 			UINT32 paddingX = child->_getPadding().left + child->_getPadding().right;
 			UINT32 paddingX = child->_getPadding().left + child->_getPadding().right;
 			UINT32 paddingY = child->_getPadding().top + child->_getPadding().bottom;
 			UINT32 paddingY = child->_getPadding().top + child->_getPadding().bottom;