[Tizen] Make mTargetSizeDirtyFlag true when Animation changes Actor's Size 23/289023/2 accepted/tizen/7.0/unified/20230302.015540 accepted/tizen/7.0/unified/20230327.042624
authorseungho baek <sbsh.baek@samsung.com>
Mon, 27 Feb 2023 09:25:14 +0000 (18:25 +0900)
committerseungho baek <sbsh.baek@samsung.com>
Mon, 27 Feb 2023 09:41:47 +0000 (18:41 +0900)
Change-Id: Ied85413cd3bf8f8fc7d19c831e35f700e225c9f4
Signed-off-by: seungho baek <sbsh.baek@samsung.com>
dali/internal/event/actors/actor-sizer.cpp

index eeee644..6add34d 100644 (file)
@@ -682,7 +682,13 @@ float ActorSizer::GetMaximumSize(Dimension::Type dimension) const
 
 void ActorSizer::OnAnimateSize(Animation& animation, Vector3 targetSize, bool relative)
 {
-  mTargetSize      = targetSize + mTargetSize * float(relative);
+  Vector3 originalTargetSize = mTargetSize;
+  mTargetSize                = targetSize + mTargetSize * float(relative);
+  if(originalTargetSize != mTargetSize)
+  {
+    mTargetSizeDirtyFlag = true;
+  }
+
   mAnimatedSize    = mTargetSize;
   mUseAnimatedSize = AnimatedSizeFlag::WIDTH | AnimatedSizeFlag::HEIGHT | AnimatedSizeFlag::DEPTH;
 
@@ -698,7 +704,12 @@ void ActorSizer::OnAnimateSize(Animation& animation, Vector3 targetSize, bool re
 
 void ActorSizer::OnAnimateWidth(Animation& animation, float width, bool relative)
 {
+  const float originalWidth = mTargetSize.width;
   mTargetSize.width   = width + float(relative) * mTargetSize.width;
+  if(!Equals(originalWidth, mTargetSize.width))
+  {
+    mTargetSizeDirtyFlag = true;
+  }
   mAnimatedSize.width = mTargetSize.width;
   mUseAnimatedSize |= AnimatedSizeFlag::WIDTH;
 
@@ -713,7 +724,12 @@ void ActorSizer::OnAnimateWidth(Animation& animation, float width, bool relative
 
 void ActorSizer::OnAnimateHeight(Animation& animation, float height, bool relative)
 {
+  const float originalHeight = mTargetSize.height;
   mTargetSize.height   = height + float(relative) * mTargetSize.height;
+  if(!Equals(originalHeight, mTargetSize.height))
+  {
+    mTargetSizeDirtyFlag = true;
+  }
   mAnimatedSize.height = mTargetSize.height;
   mUseAnimatedSize |= AnimatedSizeFlag::HEIGHT;
 
@@ -728,7 +744,12 @@ void ActorSizer::OnAnimateHeight(Animation& animation, float height, bool relati
 
 void ActorSizer::OnAnimateDepth(Animation& animation, float depth, bool relative)
 {
+  const float originalDepth = mTargetSize.depth;
   mTargetSize.depth   = depth + float(relative) * mTargetSize.depth;
+  if(!Equals(originalDepth, mTargetSize.depth))
+  {
+    mTargetSizeDirtyFlag = true;
+  }
   mAnimatedSize.depth = mTargetSize.depth;
   mUseAnimatedSize |= AnimatedSizeFlag::DEPTH;