Update the preferred size after relayoutting
[platform/core/uifw/dali-core.git] / dali / internal / event / actors / actor-property-handler.cpp
index 648b135..cce13c8 100644 (file)
@@ -25,6 +25,7 @@
 #include <dali/devel-api/actors/actor-devel.h>
 
 #include <dali/internal/event/actors/actor-impl.h>
+#include <dali/internal/event/actors/actor-relayouter.h>
 #include <dali/internal/event/common/property-helper.h>
 #include <dali/internal/update/nodes/node-declarations.h>
 #include <dali/internal/update/nodes/node-messages.h>
@@ -801,6 +802,12 @@ void Actor::PropertyHandler::OnNotifyDefaultPropertyAnimation(Internal::Actor& a
             actor.mAnimatedSize    = actor.mTargetSize;
             actor.mUseAnimatedSize = AnimatedSizeFlag::WIDTH | AnimatedSizeFlag::HEIGHT | AnimatedSizeFlag::DEPTH;
 
+            if(actor.mRelayoutData && !actor.mRelayoutData->relayoutRequested)
+            {
+              actor.mRelayoutData->preferredSize.width  = actor.mAnimatedSize.width;
+              actor.mRelayoutData->preferredSize.height = actor.mAnimatedSize.height;
+            }
+
             // Notify deriving classes
             actor.OnSizeAnimation(animation, actor.mTargetSize);
           }
@@ -814,6 +821,11 @@ void Actor::PropertyHandler::OnNotifyDefaultPropertyAnimation(Internal::Actor& a
             actor.mAnimatedSize.width = actor.mTargetSize.width;
             actor.mUseAnimatedSize |= AnimatedSizeFlag::WIDTH;
 
+            if(actor.mRelayoutData && !actor.mRelayoutData->relayoutRequested)
+            {
+              actor.mRelayoutData->preferredSize.width = actor.mAnimatedSize.width;
+            }
+
             // Notify deriving classes
             actor.OnSizeAnimation(animation, actor.mTargetSize);
           }
@@ -827,6 +839,11 @@ void Actor::PropertyHandler::OnNotifyDefaultPropertyAnimation(Internal::Actor& a
             actor.mAnimatedSize.height = actor.mTargetSize.height;
             actor.mUseAnimatedSize |= AnimatedSizeFlag::HEIGHT;
 
+            if(actor.mRelayoutData && !actor.mRelayoutData->relayoutRequested)
+            {
+              actor.mRelayoutData->preferredSize.height = actor.mAnimatedSize.height;
+            }
+
             // Notify deriving classes
             actor.OnSizeAnimation(animation, actor.mTargetSize);
           }
@@ -957,6 +974,12 @@ void Actor::PropertyHandler::OnNotifyDefaultPropertyAnimation(Internal::Actor& a
             actor.mAnimatedSize    = actor.mTargetSize;
             actor.mUseAnimatedSize = AnimatedSizeFlag::WIDTH | AnimatedSizeFlag::HEIGHT | AnimatedSizeFlag::DEPTH;
 
+            if(actor.mRelayoutData && !actor.mRelayoutData->relayoutRequested)
+            {
+              actor.mRelayoutData->preferredSize.width  = actor.mAnimatedSize.width;
+              actor.mRelayoutData->preferredSize.height = actor.mAnimatedSize.height;
+            }
+
             // Notify deriving classes
             actor.OnSizeAnimation(animation, actor.mTargetSize);
           }
@@ -970,6 +993,11 @@ void Actor::PropertyHandler::OnNotifyDefaultPropertyAnimation(Internal::Actor& a
             actor.mAnimatedSize.width = actor.mTargetSize.width;
             actor.mUseAnimatedSize |= AnimatedSizeFlag::WIDTH;
 
+            if(actor.mRelayoutData && !actor.mRelayoutData->relayoutRequested)
+            {
+              actor.mRelayoutData->preferredSize.width = actor.mAnimatedSize.width;
+            }
+
             // Notify deriving classes
             actor.OnSizeAnimation(animation, actor.mTargetSize);
           }
@@ -983,6 +1011,11 @@ void Actor::PropertyHandler::OnNotifyDefaultPropertyAnimation(Internal::Actor& a
             actor.mAnimatedSize.height = actor.mTargetSize.height;
             actor.mUseAnimatedSize |= AnimatedSizeFlag::HEIGHT;
 
+            if(actor.mRelayoutData && !actor.mRelayoutData->relayoutRequested)
+            {
+              actor.mRelayoutData->preferredSize.height = actor.mAnimatedSize.height;
+            }
+
             // Notify deriving classes
             actor.OnSizeAnimation(animation, actor.mTargetSize);
           }