// pixel format / size - set from JSON
// aspect ratio property needs to be able to be constrained also for cameras. (now do-able)
// default near clip value
-// mChildrenRoot Add()/Remove() overloads - better solution
/////////////////////////////////////////////////////////
return handle;
}
-/////////////////////////////////////////////////////////////
-// for creating a subtree for all user added child actors.
-// TODO: overloading Actor::Add()/Remove() not nice since breaks polymorphism. Need another method to pass ownership of added child actors to our internal actor root.
-void ShadowView::Add(Actor child)
-{
- mChildrenRoot.Add(child);
-}
-
-void ShadowView::Remove(Actor child)
-{
- mChildrenRoot.Remove(child);
-}
-
void ShadowView::SetShadowPlaneBackground(Actor shadowPlaneBackground)
{
mShadowPlaneBg = shadowPlaneBackground;
void ShadowView::OnInitialize()
{
// root actor to parent all user added actors. Used as source actor for shadow render task.
- mChildrenRoot.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
+ mChildrenRoot.SetParentOrigin( ParentOrigin::CENTER );
mChildrenRoot.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Vector2 stageSize = Stage::GetCurrent().GetSize();
mBlurRootActor.SetName( "BLUR_ROOT_ACTOR" );
// Turn off inheritance to ensure filter renders properly
- mBlurRootActor.SetPositionInheritanceMode(USE_PARENT_POSITION);
+ mBlurRootActor.SetParentOrigin( ParentOrigin::CENTER );
+ mBlurRootActor.SetInheritPosition(false);
mBlurRootActor.SetInheritOrientation(false);
mBlurRootActor.SetInheritScale(false);
mBlurRootActor.SetColorMode(USE_OWN_COLOR);
blurStrengthConstraint.Apply();
}
-void ShadowView::OnSizeSet(const Vector3& targetSize)
+void ShadowView::OnChildAdd( Actor& child )
{
+ Control::OnChildAdd( child );
+
+ if( child != mChildrenRoot && child != mBlurRootActor)
+ {
+ mChildrenRoot.Add( child );
+ }
+}
+
+void ShadowView::OnChildRemove( Actor& child )
+{
+ mChildrenRoot.Remove( child );
+
+ Control::OnChildRemove( child );
}
void ShadowView::ConstrainCamera()