Ensure actor size is set to node if different 44/249544/2
authorDavid Steele <david.steele@samsung.com>
Mon, 14 Dec 2020 14:06:05 +0000 (14:06 +0000)
committerDavid Steele <david.steele@samsung.com>
Mon, 14 Dec 2020 17:27:38 +0000 (17:27 +0000)
Change-Id: I9a47c38321d7753747261f7bd140a6cb58330d58

dali/internal/event/actors/actor-impl.cpp

index f2ae10b..2eabd0c 100644 (file)
@@ -798,9 +798,14 @@ void Actor::SetSizeInternal(const Vector3& size)
   // dont allow recursive loop
   DALI_ASSERT_ALWAYS(!mInsideOnSizeSet && "Cannot call SetSize from OnSizeSet");
   // check that we have a node AND the new size width, height or depth is at least a little bit different from the old one
-  if((fabsf(mTargetSize.width - size.width) > Math::MACHINE_EPSILON_1) ||
-     (fabsf(mTargetSize.height - size.height) > Math::MACHINE_EPSILON_1) ||
-     (fabsf(mTargetSize.depth - size.depth) > Math::MACHINE_EPSILON_1))
+  Vector3 currentSize = GetCurrentSize();
+
+  if( ( fabsf( mTargetSize.width - size.width  ) > Math::MACHINE_EPSILON_1 )||
+      ( fabsf( mTargetSize.height- size.height ) > Math::MACHINE_EPSILON_1 )||
+      ( fabsf( mTargetSize.depth - size.depth  ) > Math::MACHINE_EPSILON_1 )||
+      ( fabsf( mTargetSize.width - currentSize.width  ) > Math::MACHINE_EPSILON_1 )||
+      ( fabsf( mTargetSize.height- currentSize.height ) > Math::MACHINE_EPSILON_1 )||
+      ( fabsf( mTargetSize.depth - currentSize.depth  ) > Math::MACHINE_EPSILON_1 ) )
   {
     mTargetSize = size;