X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fflex-container%2Fflex-container-impl.cpp;h=650e5cf4ca901394b8aa4061808b3a2433fbe30e;hb=9d8c0bfbf6a4dfa8aa4a94f8884bc8b5989cbdbc;hp=03d45830ce41c992718243f6813310c66a159900;hpb=cd2db445fc95fed65cb9d966e672cb6976a10d0d;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp b/dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp index 03d4583..650e5cf 100644 --- a/dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp +++ b/dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -465,10 +466,6 @@ Property::Value FlexContainer::GetProperty( BaseObject* object, Property::Index void FlexContainer::OnChildAdd( Actor& child ) { - // Anchor actor to top left of the container - child.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - child.SetParentOrigin( ParentOrigin::TOP_LEFT ); - // Create a new node for the child. FlexItemNode childNode; childNode.actor = child; @@ -505,6 +502,13 @@ void FlexContainer::OnRelayout( const Vector2& size, RelayoutContainer& containe Actor child = mChildrenNodes[i].actor.GetHandle(); if( child ) { + // Anchor actor to top left of the container + if( child.GetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT ).Get< bool >() ) + { + child.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + } + child.SetParentOrigin( ParentOrigin::TOP_LEFT ); + float negotiatedWidth = child.GetRelayoutSize(Dimension::WIDTH); float negotiatedHeight = child.GetRelayoutSize(Dimension::HEIGHT);