- mClipper = Clipper::New( size );
- self.Add( mClipper->GetRootActor() );
- self.Add( mClipper->GetImageView() );
- }
- else if ( mClipper )
- {
- mClipper->Refresh( size );
- }
- }
- }
- else
- {
- // Note - this will automatically remove the root actor & the image view
- mClipper.Reset();
+ // Creates a background visual. Even if the color is transparent it updates the stencil.
+ Property::Map backGroundMap;
+ backGroundMap[Toolkit::Visual::Property::TYPE] = Visual::COLOR;
+ backGroundMap[ColorVisual::Property::MIX_COLOR] = Color::TRANSPARENT;
+
+ mStencil.SetProperty( Toolkit::Control::Property::BACKGROUND, backGroundMap );
+
+ // Enable the clipping property.
+ mStencil.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
+ mStencil.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+
+ Self().Add( mStencil );