}
}
+ Property::Value* transform = propertyMap.Find( Toolkit::Visual::DevelProperty::TRANSFORM, TRANSFORM );
+ if( transform )
+ {
+ Property::Map map;
+ if( transform->Get( map ) )
+ {
+ mImpl->mTransform.SetPropertyMap( map );
+ }
+ }
+
DoSetProperties( propertyMap );
}
+void Visual::Base::SetTransformAndSize( const Property::Map& transform, Size controlSize )
+{
+ mImpl->mControlSize = controlSize;
+ mImpl->mTransform.SetPropertyMap( transform );
+ OnSetTransform();
+}
+
void Visual::Base::SetName( const std::string& name )
{
mImpl->mName = name;
return mImpl->mName;
}
-void Visual::Base::SetSize( const Vector2& size )
-{
- mImpl->mSize = size;
-}
-
-const Vector2& Visual::Base::GetSize() const
-{
- return mImpl->mSize;
-}
-
float Visual::Base::GetHeightForWidth( float width ) const
{
return 0.f;
}
-void Visual::Base::GetNaturalSize( Vector2& naturalSize ) const
+void Visual::Base::GetNaturalSize( Vector2& naturalSize )
{
naturalSize = Vector2::ZERO;
}
void Visual::Base::SetOnStage( Actor& actor )
{
- // To display the actor correctly, renderer should not be added to actor until all required resources are ready.
- // Thus the calling of actor.AddRenderer() should happen inside derived class as base class does not know the exact timing.
- DoSetOnStage( actor );
+ if( !IsOnStage() )
+ {
+ // To display the actor correctly, renderer should not be added to actor until all required resources are ready.
+ // Thus the calling of actor.AddRenderer() should happen inside derived class as base class does not know the exact timing.
+ DoSetOnStage( actor );
- mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, IsPreMultipliedAlphaEnabled());
- mImpl->mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, mImpl->mDepthIndex );
- mImpl->mFlags |= Impl::IS_ON_STAGE;
+ if( mImpl->mRenderer )
+ {
+ mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, IsPreMultipliedAlphaEnabled());
+ mImpl->mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, mImpl->mDepthIndex );
+ mImpl->mFlags |= Impl::IS_ON_STAGE; // Only sets the flag if renderer exists
+ }
+ }
}
void Visual::Base::SetOffStage( Actor& actor )
{
mImpl->mCustomShader->CreatePropertyMap( map );
}
+
+ Property::Map transform;
+ mImpl->mTransform.GetPropertyMap( transform );
+ map.Insert( Toolkit::Visual::DevelProperty::TRANSFORM, transform );
}
void Visual::Base::EnablePreMultipliedAlpha( bool preMultipled )
if( index < VISUAL_PROPERTY_START_INDEX )
{
+ if( index == Dali::Toolkit::Visual::DevelProperty::TRANSFORM )
+ {
+ Property::Map* transformMap = propertyValue.GetMap();
+ if( transformMap )
+ {
+ SetTransformAndSize( *transformMap, mImpl->mControlSize );
+ }
+ }
+
// TODO set the properties of the visual base.
}
else
if( index < VISUAL_PROPERTY_START_INDEX )
{
+ if( index == Dali::Toolkit::Visual::DevelProperty::TRANSFORM )
+ {
+ Property::Map map;
+ mImpl->mTransform.GetPropertyMap( map );
+ return map;
+ }
// TODO retrieve the properties of the visual base.
}
else