Change LayoutItem::SetParent to set LayoutItem::Impl::PRIVATE_FLAG_FORCE_SET_FRAME... 17/188617/5
authorAnton Obzhirov <a.obzhirov@samsung.com>
Thu, 6 Sep 2018 15:04:22 +0000 (16:04 +0100)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Fri, 5 Oct 2018 16:59:32 +0000 (17:59 +0100)
Now it is setting in LayoutItem::SetFrame
and clearing in LayoutItem::SetParent, should be swapped.

Change-Id: Ifca2a432d119600fb4ff3a9351469e26d2661a02

dali-toolkit/devel-api/layouting/layout-item-impl.cpp

index 78cd532..d68e544 100644 (file)
@@ -310,10 +310,7 @@ void LayoutItem::OnLayout( bool changed, LayoutLength left, LayoutLength top, La
 void LayoutItem::SetParent( LayoutParent* parent )
 {
   mImpl->mLayoutParent = parent;
-  if ( parent == nullptr )
-  {
-    mImpl->ClearPrivateFlag( Impl::PRIVATE_FLAG_FORCE_SET_FRAME );
-  }
+  mImpl->SetPrivateFlag( Impl::PRIVATE_FLAG_FORCE_SET_FRAME );
 }
 
 LayoutParent* LayoutItem::GetParent()
@@ -438,7 +435,7 @@ bool LayoutItem::SetFrame( LayoutLength left, LayoutLength top, LayoutLength rig
 
   DALI_LOG_STREAM( gLayoutFilter, Debug::Verbose, "LayoutItem::SetFrame enter(" << left << ", " << top << ", " << right << ", " << bottom << ")\n" );
 
-  if( mImpl->mLeft != left || mImpl->mRight != right || mImpl->mTop != top || mImpl->mBottom != bottom || !mImpl->GetPrivateFlag( Impl::PRIVATE_FLAG_FORCE_SET_FRAME ) )
+  if( mImpl->mLeft != left || mImpl->mRight != right || mImpl->mTop != top || mImpl->mBottom != bottom || mImpl->GetPrivateFlag( Impl::PRIVATE_FLAG_FORCE_SET_FRAME ) )
   {
     changed = true;
 
@@ -453,7 +450,7 @@ bool LayoutItem::SetFrame( LayoutLength left, LayoutLength top, LayoutLength rig
     mImpl->mRight = right;
     mImpl->mBottom = bottom;
 
-    mImpl->SetPrivateFlag( Impl::PRIVATE_FLAG_FORCE_SET_FRAME );
+    mImpl->ClearPrivateFlag( Impl::PRIVATE_FLAG_FORCE_SET_FRAME );
 
 
     // Reflect up to parent control