fix defect in Update BuilderBounds
authorkeonpyo.kong <keonpyo.kong@samsung.com>
Fri, 5 Apr 2013 11:15:26 +0000 (20:15 +0900)
committerkeonpyo.kong <keonpyo.kong@samsung.com>
Fri, 5 Apr 2013 11:15:26 +0000 (20:15 +0900)
Change-Id: Ia566fdca3ac0db5e3fe4535a4064633f94eb62b8
Signed-off-by: keonpyo.kong <keonpyo.kong@samsung.com>
src/ui/FUi_ControlImpl.cpp

index a516d08..09750a3 100755 (executable)
@@ -3559,33 +3559,52 @@ _ControlImpl::GetSizeF(void) const
 }
 
 void
- _ControlImpl::UpdateBuilderBounds(const Tizen::Graphics::FloatRectangle& bounds)
-{
-    FloatRectangle builderBounds;
-
-    _ControlOrientation controlOrientation = _CONTROL_ORIENTATION_PORTRAIT;
-    bool exist = GetBuilderBoundsF(controlOrientation, builderBounds);
-    if (exist)
-    {
-        if (IsAttachedToMainTree())
-        {
-               controlOrientation = GetCore().GetOrientation();
-
-               if (controlOrientation == _CONTROL_ORIENTATION_LANDSCAPE)
-               {
-                       SetBuilderBounds(_CONTROL_ORIENTATION_LANDSCAPE, bounds);
-               }
-               else
-            {
+_ControlImpl::UpdateBuilderBounds(const Tizen::Graphics::FloatRectangle& bounds)
+{
+       FloatRectangle builderBounds;
+       _ControlOrientation controlOrientation = _CONTROL_ORIENTATION_PORTRAIT;
+       bool exist = GetBuilderBoundsF(controlOrientation, builderBounds);
+       if (exist)
+       {
+               if (IsAttachedToMainTree())
+               {
+                       _Window* pWindow = GetCore().GetRootWindow();
+                       if (pWindow->IsOrientationRoot())
+                       {
+                               // Frame
+                               _ControlImplManager* pControlImplManager = _ControlImplManager::GetInstance();
+                               OrientationStatus orientationStatus = pControlImplManager->GetFormOrientationStatus(this);
+
+                               if ((orientationStatus == ORIENTATION_STATUS_LANDSCAPE) || (orientationStatus == ORIENTATION_STATUS_LANDSCAPE_REVERSE))
+                               {
+                                       controlOrientation = _CONTROL_ORIENTATION_LANDSCAPE;
+                               }
+                               else
+                               {
+                                       controlOrientation = _CONTROL_ORIENTATION_PORTRAIT;
+                               }
+                       }
+                       else
+                       {
+                               // Window
+                               controlOrientation = GetCore().GetOrientation();
+                       }
+
+                       if (controlOrientation == _CONTROL_ORIENTATION_LANDSCAPE)
+                       {
+                               SetBuilderBounds(_CONTROL_ORIENTATION_LANDSCAPE, bounds);
+                       }
+                       else
+                       {
                                SetBuilderBounds(_CONTROL_ORIENTATION_PORTRAIT, bounds);
-            }
-        }
-        else
-        {
-            SetBuilderBounds(_CONTROL_ORIENTATION_PORTRAIT, bounds);
-            SetBuilderBounds(_CONTROL_ORIENTATION_LANDSCAPE, bounds);
-        }
-    }
+                       }
+               }
+               else
+               {
+                       SetBuilderBounds(_CONTROL_ORIENTATION_PORTRAIT, bounds);
+                       SetBuilderBounds(_CONTROL_ORIENTATION_LANDSCAPE, bounds);
+               }
+       }
 }
 
 void