From: Xiangyin Ma Date: Wed, 21 Dec 2016 14:47:07 +0000 (+0000) Subject: Fix a bug in control background setting X-Git-Tag: submit/tizen_3.0/20161230.052259~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F52%2F106452%2F1;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git Fix a bug in control background setting Change-Id: I25eef3eff01496eb28ac12be79443e783fb09168 --- diff --git a/dali-toolkit/public-api/controls/control-impl.cpp b/dali-toolkit/public-api/controls/control-impl.cpp index e9a866e..e0e1383 100644 --- a/dali-toolkit/public-api/controls/control-impl.cpp +++ b/dali-toolkit/public-api/controls/control-impl.cpp @@ -460,12 +460,16 @@ Vector4 Control::GetBackgroundColor() const void Control::SetBackground( const Property::Map& map ) { Actor self( Self() ); - Toolkit::Visual::Base backgroundVisual; - InitializeVisual( self, backgroundVisual, map ); + Toolkit::Visual::Base backgroundVisual = Toolkit::VisualFactory::Get().CreateVisual( map ); // if new visual created, replace existing one if( backgroundVisual ) { + if( self.OnStage() ) + { + mImpl->mBackgroundVisual.RemoveAndReset( self ); + backgroundVisual.SetOnStage( self ); + } mImpl->mBackgroundVisual = backgroundVisual; mImpl->mBackgroundVisual.SetDepthIndex( DepthIndex::BACKGROUND ); }