Animation issue fixes
authorSaravana Balaji S <saravana.bs@samsung.com>
Mon, 9 Sep 2013 07:59:20 +0000 (16:59 +0900)
committerVinay Dutt Vyas <vinay.vyas@samsung.com>
Wed, 11 Sep 2013 06:11:26 +0000 (11:41 +0530)
Change-Id: I321712335c935998e6ac5e4865e44528bf4da49b
Signed-off-by: Saravana Balaji S <saravana.bs@samsung.com>
Signed-off-by: Vinay Dutt Vyas <vinay.vyas@samsung.com>
src/ui/animations/FUiAnim_ControlAnimatorImpl.cpp

index 7697497..25033e7 100644 (file)
@@ -380,7 +380,7 @@ _ControlAnimatorImpl::SetAnimation(AnimationTargetType animTarget, AnimationBase
                FloatRectangle presentationBounds = const_cast<VisualElement*>((__pVisualElement)->AcquirePresentationInstance())->GetBounds();
                FloatRectangle modelBounds = __pVisualElement->GetBounds();
 
-               __presentationBounds = presentationBounds;
+               __presentationBounds = modelBounds;
 
                float currentAnchorX = presentationBounds.width * anchorX;
                float currentAnchorY = presentationBounds.height * anchorY;
@@ -391,8 +391,8 @@ _ControlAnimatorImpl::SetAnimation(AnimationTargetType animTarget, AnimationBase
                float endAnchorX = endWidth * anchorX;
                float endAnchorY = endHeight * anchorY;
 
-               float startX = presentationBounds.x + (currentAnchorX - startAnchorX);
-               float startY = presentationBounds.y + (currentAnchorY - startAnchorY);
+               float startX = modelBounds.x + (currentAnchorX - startAnchorX);
+               float startY = modelBounds.y + (currentAnchorY - startAnchorY);
 
                float endX = modelBounds.x + (currentAnchorX - endAnchorX);
                float endY = modelBounds.y + (currentAnchorY - endAnchorY);
@@ -937,10 +937,21 @@ _ControlAnimatorImpl::SetGroupAnimation(AnimationGroup* pAnimGrp)
                                else
                                {
                                        if (pParallelAnimGrp->IsAnimationAdded(ANIMATION_TARGET_POSITION) ||
-                                               pParallelAnimGrp->IsAnimationAdded(ANIMATION_TARGET_SIZE))
+                                                       pParallelAnimGrp->IsAnimationAdded(ANIMATION_TARGET_SIZE))
                                        {
-                                               __logicalBoundsHolder = __pControl->GetBounds();
-                                               setLogicalBnds = true;
+                                               Rectangle controlRect = __pControl->GetBounds();
+                                               if(animTarget == ANIMATION_TARGET_POSITION)
+                                               {
+                                                       setLogicalBnds = true;
+                                                       __logicalBoundsHolder.x = controlRect.x;
+                                                       __logicalBoundsHolder.y = controlRect.y;
+                                               }
+                                               else if(animTarget == ANIMATION_TARGET_SIZE)
+                                               {
+                                                       setLogicalBnds = true;
+                                                       __logicalBoundsHolder.width = controlRect.width;
+                                                       __logicalBoundsHolder.height = controlRect.height;
+                                               }
                                        }
                                        else if (pParallelAnimGrp->IsAnimationAdded(ANIMATION_TARGET_ALPHA))
                                        {
@@ -2999,7 +3010,7 @@ _ControlAnimatorImpl::OnVisualElementAnimationFinished(const VisualElementAnimat
 
                                if ((propName.IndexOf(VeSubPropBoundsPosition, startIndex, indexOf)) == E_SUCCESS)
                                {
-                                       r = pPresentationImpl->SetProperty(VePropBounds, __pVisualElement->GetBounds());
+                                       r = pPresentationImpl->SetProperty(VeSubPropBoundsPosition, FloatPoint(__pVisualElement->GetBounds().x, __pVisualElement->GetBounds().y));
                                }
                                else if ((propName.IndexOf(VePropBounds, startIndex, indexOf)) == E_SUCCESS)
                                {
@@ -3111,15 +3122,15 @@ _ControlAnimatorImpl::OnTickOccurred(const VisualElementAnimation& animation, co
                float diffX = 0.0f;
                float diffY = 0.0f;
 
-               if (!pAnimation->IsEndValueApplied() && (__isAnimationTargetAnimating[ANIMATION_TARGET_POSITION]))
+               if (__isAnimationTargetAnimating[ANIMATION_TARGET_POSITION])
                {
                        diffX = pPresentation->GetBounds().x + currentValue.ToFloatRectangle().x - __presentationBounds.x;
                        diffY = pPresentation->GetBounds().y + currentValue.ToFloatRectangle().y - __presentationBounds.y;
                }
                else
                {
-                       diffX = pPresentation->GetBounds().x;
-                       diffY = pPresentation->GetBounds().y;
+                       diffX = currentValue.ToFloatRectangle().x;
+                       diffY = currentValue.ToFloatRectangle().y;
                }
 
                Variant newBounds(FloatRectangle(diffX, diffY, currentValue.ToFloatRectangle().width, currentValue.ToFloatRectangle().height));
@@ -3568,7 +3579,7 @@ _ControlAnimatorImpl::SetAnimationF(AnimationTargetType animTarget, ControlAnima
                FloatRectangle presentationBounds = const_cast<VisualElement*>((__pVisualElement)->AcquirePresentationInstance())->GetBounds();
                FloatRectangle modelBounds = __pVisualElement->GetBounds();
 
-               __presentationBounds = presentationBounds;
+               __presentationBounds = modelBounds;
 
                float startX = presentationBounds.x;
                float startY = presentationBounds.y;