if (__pCurrentLayout != null)
{
- LayoutRect calculatedRect;
- GetItemWindowRect(calculatedRect);
- calculatedRect.w = measuredWidth;
- calculatedRect.h = measuredHeight;
- SetItemWindowRect(calculatedRect);
+ LayoutRect containerClientRect = {0.0f, 0.0f, measuredWidth, measuredHeight};
+ ConvertWindowToClientBounds(containerClientRect, containerClientRect);
- ConvertWindowToClientBounds(calculatedRect, calculatedRect);
-
- LayoutSize containerSize = {calculatedRect.w, calculatedRect.h};
+ LayoutSize containerSize = {containerClientRect.w, containerClientRect.h};
SetIntendedWindowSize(containerSize);
__pCurrentLayout->OnLayout(measuredWidth, measuredHeight, true);
float wrapContentWidth = 0.0f;
float wrapContentHeight = 0.0f;
- Tizen::Graphics::FloatDimension size = __pOuterControl->GetItemContentSize();
-
- if (size.width > 0 || size.height > 0)
- {
- __contentSizeState = true;
- wrapContentWidth = size.width;
- wrapContentHeight = size.height;
- }
- else
+ if (widthMode == WRAP_CONTENT || heightMode == WRAP_CONTENT)
{
- wrapContentWidth = width;
- wrapContentHeight = height;
+ Tizen::Graphics::FloatDimension size = __pOuterControl->GetItemContentSize();
+ if (size.width > 0.0f || size.height > 0.0f)
+ {
+ __contentSizeState = true;
+ wrapContentWidth = size.width;
+ wrapContentHeight = size.height;
+ }
+ else
+ {
+ __contentSizeState = false;
+ wrapContentWidth = width;
+ wrapContentHeight = height;
+ }
}
if (widthMode == NONE_MODE)
#include <new>
#include <FBaseSysLog.h>
+#include "FUi_Math.h"
#include "FUi_LayoutLayoutItemProxy.h"
#include "FUi_LayoutLayoutContainer.h"
LayoutItemProxy::GetItemWindowRect(LayoutRect& itemRect) const
{
SysAssertf(__pItem != null, "LayoutItem is invalid");
- if (__calculatedRect.x == 0 && __calculatedRect.y == 0 && __calculatedRect.w == 0 && __calculatedRect.h == 0)
+ if (_FloatCompare(__calculatedRect.x, 0.0f) && _FloatCompare(__calculatedRect.y, 0.0f) && _FloatCompare(__calculatedRect.w, 0.0f) && _FloatCompare(__calculatedRect.h, 0.0f))
{
__pItem->GetItemWindowRect(itemRect);
}