From: Adeel Kazmi Date: Tue, 7 Mar 2017 12:25:20 +0000 (+0000) Subject: Layout containers won't change anchor-point if the position does not use it X-Git-Tag: dali_1.2.30~4 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=5a0d4bcc95d9456a5bb948950da126e802a541b5 Layout containers won't change anchor-point if the position does not use it Change-Id: I87274ca3356e12ca4eb4c7caac5f0b238704fc0f --- 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); diff --git a/dali-toolkit/internal/controls/table-view/table-view-impl.cpp b/dali-toolkit/internal/controls/table-view/table-view-impl.cpp index b683987..43c9307 100644 --- a/dali-toolkit/internal/controls/table-view/table-view-impl.cpp +++ b/dali-toolkit/internal/controls/table-view/table-view-impl.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -816,7 +817,10 @@ void TableView::OnRelayout( const Vector2& size, RelayoutContainer& container ) if( actor && position.rowIndex == row && position.columnIndex == column ) { // Anchor actor to top left of the cell - actor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + if( actor.GetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT ).Get< bool >() ) + { + actor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + } actor.SetParentOrigin( ParentOrigin::TOP_LEFT ); Padding padding;