|
|
@@ -35,13 +35,17 @@ namespace BansheeEngine
|
|
|
GUIElement* element = static_cast<GUIElement*>(child);
|
|
|
const GUILayoutOptions& layoutOptions = element->_getLayoutOptions();
|
|
|
|
|
|
+ Int2 optimalSize;
|
|
|
+ if(!layoutOptions.fixedWidth || !layoutOptions.fixedHeight)
|
|
|
+ optimalSize = child->_getOptimalSize();
|
|
|
+
|
|
|
if(layoutOptions.fixedHeight)
|
|
|
{
|
|
|
optimalHeight = layoutOptions.height;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- optimalHeight = element->_getOptimalHeight();
|
|
|
+ optimalHeight = optimalSize.y;
|
|
|
|
|
|
if(layoutOptions.minHeight > 0)
|
|
|
optimalHeight = std::max(layoutOptions.minHeight, optimalHeight);
|
|
|
@@ -54,7 +58,7 @@ namespace BansheeEngine
|
|
|
optimalWidth = layoutOptions.width;
|
|
|
else
|
|
|
{
|
|
|
- optimalWidth = element->_getOptimalWidth();
|
|
|
+ optimalWidth = optimalSize.x;
|
|
|
|
|
|
if(layoutOptions.minWidth > 0)
|
|
|
optimalWidth = std::max(layoutOptions.minWidth, optimalWidth);
|
|
|
@@ -66,7 +70,7 @@ namespace BansheeEngine
|
|
|
else if(child->_getType() == GUIElementBase::Type::Layout)
|
|
|
{
|
|
|
GUILayout* layout = static_cast<GUILayout*>(child);
|
|
|
- optimalHeight = layout->_getOptimalHeight();
|
|
|
+ optimalHeight = layout->_getOptimalSize().y;
|
|
|
}
|
|
|
|
|
|
mOptimalSizes[childIdx].y = optimalHeight;
|
|
|
@@ -81,7 +85,7 @@ namespace BansheeEngine
|
|
|
|
|
|
void GUILayoutY::_updateLayoutInternal(INT32 x, INT32 y, UINT32 width, UINT32 height, Rect clipRect, UINT8 widgetDepth, UINT16 areaDepth)
|
|
|
{
|
|
|
- UINT32 totalOptimalSize = _getOptimalHeight();
|
|
|
+ UINT32 totalOptimalSize = _getOptimalSize().y;
|
|
|
UINT32 totalNonClampedSize = 0;
|
|
|
UINT32 numNonClampedElements = 0;
|
|
|
UINT32 numFlexibleSpaces = 0;
|