- if ( actor.GetRendererCount() )
- {
- Dali::Renderer renderer( actor.GetRendererAt( 0 ) );
- Geometry geometry = renderer.GetGeometry();
- Material material = renderer.GetMaterial();
-
- Dali::Renderer shadowRenderer = Dali::Renderer::New( geometry, material );
- shadowRenderer.SetDepthIndex( renderer.GetDepthIndex() - 1 );
- shadowActor.AddRenderer( shadowRenderer );
- shadowActor.SetParentOrigin( ParentOrigin::CENTER );
- shadowActor.SetSize( actorSize );
- shadowActor.SetColor( shadowColor );
- containerActor.Add( shadowActor );
- containerActor.Add( actor );
- actor = containerActor;
- }
+ Dali::Renderer renderer( shadowActor.GetRendererAt( 0 ) );
+ int depthIndex = renderer.GetProperty<int>(Dali::Renderer::Property::DEPTH_INDEX);
+ renderer.SetProperty( Dali::Renderer::Property::DEPTH_INDEX, depthIndex - 1 );
+ mActor.Add( shadowActor );