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

Fixed an issue where scroll bars would incorrectly appear when not needed

Marko Pintera 12 лет назад
Родитель
Сommit
d9248edd00
2 измененных файлов с 4 добавлено и 8 удалено
  1. 2 4
      BansheeEngine/Source/BsGUILayoutX.cpp
  2. 2 4
      BansheeEngine/Source/BsGUILayoutY.cpp

+ 2 - 4
BansheeEngine/Source/BsGUILayoutX.cpp

@@ -380,10 +380,8 @@ namespace BansheeEngine
 				UINT32 childHeight = layout->_getActualHeight();
 				mActualHeight = std::max(mActualHeight, childHeight);
 
-				// It's possible all elements didn't fit in the child layout size we provided, in which case expand our measurements
-				CM::UINT32 childLayoutWidth = layout->_getActualWidth();
-				if(childLayoutWidth > elemWidth)
-					elemWidth = childLayoutWidth;
+				// It's possible all elements didn't fit in the child layout size we provided, in which case adjust our measurements
+				elemWidth = layout->_getActualWidth();
 			}
 
 			mActualWidth += elemWidth;

+ 2 - 4
BansheeEngine/Source/BsGUILayoutY.cpp

@@ -379,10 +379,8 @@ namespace BansheeEngine
 
 				mActualWidth = std::max(mActualWidth, layout->_getActualWidth());
 
-				// It's possible all elements didn't fit in the child layout size we provided, in which case expand our measurements
-				CM::UINT32 childLayoutHeight = layout->_getActualHeight();
-				if(childLayoutHeight > elemHeight)
-					elemHeight = childLayoutHeight;
+				// It's possible all elements didn't fit in the child layout size we provided, in which case adjust our measurements
+				elemHeight = layout->_getActualHeight();
 			}
 
 			mActualHeight += elemHeight;