From 7e015b34bd79604bb7fa3eab78d2417df6d241ee Mon Sep 17 00:00:00 2001 From: "huiyu.eun" Date: Wed, 29 Aug 2018 11:05:36 +0900 Subject: [PATCH] Fix setting z value issue in Layout Change-Id: I3b6dd617b4150b033bb600ae74c59c1dfdeb2d67 Signed-off-by: huiyu.eun --- .../src/dali-toolkit/utc-Dali-AbsoluteLayout.cpp | 3 ++- dali-toolkit/devel-api/layouting/layout-item-impl.cpp | 16 ++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/automated-tests/src/dali-toolkit/utc-Dali-AbsoluteLayout.cpp b/automated-tests/src/dali-toolkit/utc-Dali-AbsoluteLayout.cpp index e443b7e..395e8f9 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-AbsoluteLayout.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-AbsoluteLayout.cpp @@ -78,6 +78,7 @@ int UtcDaliLayouting_AbsoluteLayout01(void) Stage stage = Stage::GetCurrent(); auto absoluteLayout = Control::New(); auto layout = AbsoluteLayout::New(); + layout.SetAnimateLayout( true ); DevelControl::SetLayout( absoluteLayout, layout ); absoluteLayout.SetName( "AsoluteLayout"); @@ -118,4 +119,4 @@ int UtcDaliLayouting_AbsoluteLayout01(void) DALI_TEST_EQUALS( controls[3].GetProperty( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION ); END_TEST; -} \ No newline at end of file +} diff --git a/dali-toolkit/devel-api/layouting/layout-item-impl.cpp b/dali-toolkit/devel-api/layouting/layout-item-impl.cpp index 71c0d46..20e23f3 100644 --- a/dali-toolkit/devel-api/layouting/layout-item-impl.cpp +++ b/dali-toolkit/devel-api/layouting/layout-item-impl.cpp @@ -469,18 +469,22 @@ bool LayoutItem::SetFrame( LayoutLength left, LayoutLength top, LayoutLength rig if( mImpl->mAnimated ) { auto animation = Animation::New( 0.5f ); - animation.AnimateTo( Property( actor, Actor::Property::POSITION ), - Vector3( float(left.mValue), float(top.mValue), 0.0f ) ); - animation.AnimateTo( Property( actor, Actor::Property::SIZE ), - Vector3( right-left, bottom-top, 0.0f ) ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), float( left.mValue ) ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION_Y ), float( top.mValue ) ); + + animation.AnimateTo( Property( actor, Actor::Property::SIZE_WIDTH ), float( newWidth ) ); + animation.AnimateTo( Property( actor, Actor::Property::SIZE_HEIGHT ), float( newHeight ) ); + animation.FinishedSignal().Connect( mSlotDelegate, &LayoutItem::OnLayoutAnimationFinished ); animation.Play(); } else { // @todo Collate into list of Property & Property::Value pairs. - actor.SetPosition( Vector3( float(left.mValue), float(top.mValue), 0.0f ) ); - actor.SetSize( Vector3( right-left, bottom-top, 0.0f ) ); + actor.SetX( float( left.mValue ) ); + actor.SetY( float( top.mValue ) ); + actor.SetProperty( Actor::Property::SIZE_WIDTH, float( newWidth ) ); + actor.SetProperty( Actor::Property::SIZE_HEIGHT, float( newHeight ) ); } } -- 2.7.4