Fix for putting an actor hierarchy onto stage.
Change-Id: Ib48ea5f2a5dde292292fe18a415fb0d6e749252a
{
RelayoutRequest();
}
-
- if( child.RelayoutDependentOnParent() )
- {
- child.RelayoutRequest();
- }
}
}
}
SetSize( Vector3( size.width, size.height, CalculateSizeZ( size ) ) );
}
+void Actor::SetSizeInternal( const Vector2& size )
+{
+ SetSizeInternal( Vector3( size.width, size.height, CalculateSizeZ( size ) ) );
+}
+
float Actor::CalculateSizeZ( const Vector2& size ) const
{
return std::min( size.width, size.height );
void Actor::SetSize( const Vector3& size )
{
+ if( IsRelayoutEnabled() && !mRelayoutData->insideRelayout )
+ {
+ SetPreferredSize( size.GetVectorXY() );
+ }
+ else
+ {
+ SetSizeInternal( size );
+ }
+}
+
+void Actor::SetSizeInternal( const Vector3& size )
+{
if( NULL != mNode )
{
mTargetSize = size;
}
#endif
+ // Request relayout on all actors that are added to the scenegraph
+ RelayoutRequest();
+
// Notification for Object::Observers
OnSceneObjectAdd();
}
void SetSize( const Vector2& size );
/**
+ * Sets the update size for an actor.
+ *
+ * @param[in] size The size to set.
+ */
+ void SetSizeInternal( const Vector2& size );
+
+ /**
* Sets the size of an actor.
* ActorAttachments attached to the actor, can be scaled to fit within this area.
* This does not interfere with the actors scale factor.
void SetSize( const Vector3& size );
/**
+ * Sets the update size for an actor.
+ *
+ * @param[in] size The size to set.
+ */
+ void SetSizeInternal( const Vector3& size );
+
+ /**
* Set the width component of the Actor's size.
* @param [in] width The new width component.
*/
if( image )
{
mInternalSetSize = true;
- SetSize( image->GetNaturalSize() );
+ SetSizeInternal( image->GetNaturalSize() );
mInternalSetSize = false;
}
}
if( mUsingNaturalSize )
{
mInternalSetSize = true;
- SetSize( CalculateNaturalSize() );
+ SetSizeInternal( CalculateNaturalSize() );
mInternalSetSize = false;
}
}
void Actor::SetSize(float width, float height)
{
- if( IsRelayoutEnabled() )
- {
- GetImplementation(*this).SetPreferredSize( Vector2( width, height ) );
- }
- else
- {
- GetImplementation(*this).SetSize(width, height);
- }
+ GetImplementation(*this).SetSize(width, height);
}
void Actor::SetSize(float width, float height, float depth)
{
- if( IsRelayoutEnabled() )
- {
- GetImplementation(*this).SetPreferredSize( Vector2( width, height ) );
- }
- else
- {
- GetImplementation(*this).SetSize(width, height, depth);
- }
+ GetImplementation(*this).SetSize(width, height, depth);
}
void Actor::SetSize(const Vector2& size)
{
- if( IsRelayoutEnabled() )
- {
- GetImplementation(*this).SetPreferredSize( size );
- }
- else
- {
- GetImplementation(*this).SetSize( size );
- }
+ GetImplementation(*this).SetSize( size );
}
void Actor::SetSize(const Vector3& size)
{
- if( IsRelayoutEnabled() )
- {
- GetImplementation(*this).SetPreferredSize( size.GetVectorXY() );
- }
- else
- {
- GetImplementation(*this).SetSize( size );
- }
+ GetImplementation(*this).SetSize( size );
}
Vector3 Actor::GetTargetSize() const