Fix animation defect - N_SE-51398
authorJaewon Cho <jaewon7.cho@samsung.com>
Mon, 9 Sep 2013 09:49:37 +0000 (18:49 +0900)
committerJaewon Cho <jaewon7.cho@samsung.com>
Mon, 9 Sep 2013 09:49:37 +0000 (18:49 +0900)
Change-Id: Icf746f88017b08865f245fd7a733565ad9d4ae51
Signed-off-by: Jaewon Cho <jaewon7.cho@samsung.com>
src/ui/FUi_Control.cpp

index b14b180..7e315d9 100644 (file)
@@ -3025,17 +3025,23 @@ result
 _Control::UpdateBoundsOfVisualElement(const FloatRectangle& controlBounds)
 {
        FloatRectangle rect(controlBounds.x, controlBounds.y, controlBounds.width, controlBounds.height);
+       FloatRectangle previousBounds = GetVisualElement()->GetBounds();
 
-       _Control* pParent = GetParent();
-       if (__area == _CONTROL_AREA_CLIENT && pParent)
-       {
-               const FloatRectangle clientBounds = pParent->GetClientBoundsF();
-               rect.x += clientBounds.x;
-               rect.y += clientBounds.y;
-       }
+       const bool moved = (previousBounds.x != rect.x) || (previousBounds.y != rect.y);
+       const bool resized = (previousBounds.width != rect.width) || (previousBounds.height != rect.height);
 
-       GetVisualElement()->SetBounds(rect);
+       if (moved || resized)
+       {
+               _Control* pParent = GetParent();
+               if (__area == _CONTROL_AREA_CLIENT && pParent)
+               {
+                       const FloatRectangle clientBounds = pParent->GetClientBoundsF();
+                       rect.x += clientBounds.x;
+                       rect.y += clientBounds.y;
+               }
 
+               GetVisualElement()->SetBounds(rect);
+       }
        return E_SUCCESS;
 }