2
0
Эх сурвалжийг харах

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

Marko Pintera 12 жил өмнө
parent
commit
d9248edd00

+ 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;