Removed top-down SetBounds().
authorJeahoon Kim <jeahoon.kim@samsung.com>
Tue, 26 Mar 2013 10:06:34 +0000 (19:06 +0900)
committerJeahoon Kim <jeahoon.kim@samsung.com>
Tue, 26 Mar 2013 10:37:16 +0000 (19:37 +0900)
Change-Id: Ia571e6b0715058839a552785cac85fb64d810472
Signed-off-by: Jeahoon Kim <jeahoon.kim@samsung.com>
src/ui/layout/FUi_LayoutLayoutContainer.cpp [changed mode: 0644->0755]
src/ui/layout/FUi_LayoutLayoutItem.cpp [changed mode: 0644->0755]
src/ui/layout/FUi_LayoutLayoutItemProxy.cpp [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index cca2da2..67f6aa5
@@ -261,15 +261,10 @@ LayoutContainer::Measure(float width, float height)
 
        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);
old mode 100644 (file)
new mode 100755 (executable)
index 76e0b19..364eac0
@@ -146,18 +146,21 @@ LayoutItem::Measure(float width, float height)
        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)
old mode 100644 (file)
new mode 100755 (executable)
index a6924dc..0af779d
@@ -23,6 +23,7 @@
 
 #include <new>
 #include <FBaseSysLog.h>
+#include "FUi_Math.h"
 #include "FUi_LayoutLayoutItemProxy.h"
 #include "FUi_LayoutLayoutContainer.h"
 
@@ -174,7 +175,7 @@ void
 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);
        }