SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mSize, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeX, width );
}
+ mUseAnimatedSize &= ~AnimatedSizeFlag::WIDTH;
+
RelayoutRequest();
}
SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mSize, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeY, height );
}
+ mUseAnimatedSize &= ~AnimatedSizeFlag::HEIGHT;
+
RelayoutRequest();
}
{
mTargetSize.depth = depth;
+ mUseAnimatedSize &= ~AnimatedSizeFlag::DEPTH;
+
// node is being used in a separate thread; queue a message to set the value & base value
SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mSize, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeZ, depth );
}
{
Vector3 size = mTargetSize;
- // Should return preferred size if size is fixed as set by SetSize
- if( GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::FIXED )
+ if( mUseAnimatedSize & AnimatedSizeFlag::WIDTH )
+ {
+ // Should return animated size if size is animated
+ size.width = mAnimatedSize.width;
+ }
+ else
+ {
+ // Should return preferred size if size is fixed as set by SetSize
+ if( GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::FIXED )
+ {
+ size.width = GetPreferredSize().width;
+ }
+ }
+
+ if( mUseAnimatedSize & AnimatedSizeFlag::HEIGHT )
{
- size.width = GetPreferredSize().width;
+ size.height = mAnimatedSize.height;
+ }
+ else
+ {
+ if( GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::FIXED )
+ {
+ size.height = GetPreferredSize().height;
+ }
}
- if( GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::FIXED )
+
+ if( mUseAnimatedSize & AnimatedSizeFlag::DEPTH )
{
- size.height = GetPreferredSize().height;
+ size.depth = mAnimatedSize.depth;
}
return size;
mTargetSize( Vector3::ZERO ),
mTargetPosition( Vector3::ZERO ),
mTargetScale( Vector3::ONE ),
+ mAnimatedSize( Vector3::ZERO ),
mName(),
mSortedDepth( 0u ),
mDepth( 0u ),
+ mUseAnimatedSize( AnimatedSizeFlag::CLEAR ),
mIsRoot( ROOT_LAYER == derivedType ),
mIsLayer( LAYER == derivedType || ROOT_LAYER == derivedType ),
mIsOnStage( false ),
{
if( value.Get( mTargetSize ) )
{
- if( mRelayoutData )
- {
- if( GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::FIXED )
- {
- mRelayoutData->preferredSize.width = mTargetSize.width;
- }
-
- if( GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::FIXED )
- {
- mRelayoutData->preferredSize.height = mTargetSize.height;
- }
- }
+ mAnimatedSize = mTargetSize;
+ mUseAnimatedSize = AnimatedSizeFlag::WIDTH | AnimatedSizeFlag::HEIGHT | AnimatedSizeFlag::DEPTH;
// Notify deriving classes
OnSizeAnimation( animation, mTargetSize );
{
if( value.Get( mTargetSize.width ) )
{
- if( mRelayoutData && GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::FIXED )
- {
- mRelayoutData->preferredSize.width = mTargetSize.width;
- }
+ mAnimatedSize.width = mTargetSize.width;
+ mUseAnimatedSize |= AnimatedSizeFlag::WIDTH;
// Notify deriving classes
OnSizeAnimation( animation, mTargetSize );
{
if( value.Get( mTargetSize.height ) )
{
- if( mRelayoutData && GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::FIXED )
- {
- mRelayoutData->preferredSize.height = mTargetSize.height;
- }
+ mAnimatedSize.height = mTargetSize.height;
+ mUseAnimatedSize |= AnimatedSizeFlag::HEIGHT;
// Notify deriving classes
OnSizeAnimation( animation, mTargetSize );
{
if( value.Get( mTargetSize.depth ) )
{
+ mAnimatedSize.depth = mTargetSize.depth;
+ mUseAnimatedSize |= AnimatedSizeFlag::DEPTH;
+
// Notify deriving classes
OnSizeAnimation( animation, mTargetSize );
}
{
if( AdjustValue< Vector3 >( mTargetSize, value ) )
{
- if( mRelayoutData )
- {
- if( GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::FIXED )
- {
- mRelayoutData->preferredSize.width = mTargetSize.width;
- }
-
- if( GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::FIXED )
- {
- mRelayoutData->preferredSize.height = mTargetSize.height;
- }
- }
+ mAnimatedSize = mTargetSize;
+ mUseAnimatedSize = AnimatedSizeFlag::WIDTH | AnimatedSizeFlag::HEIGHT | AnimatedSizeFlag::DEPTH;
// Notify deriving classes
OnSizeAnimation( animation, mTargetSize );
{
if( AdjustValue< float >( mTargetSize.width, value ) )
{
- if( mRelayoutData && GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::FIXED )
- {
- mRelayoutData->preferredSize.width = mTargetSize.width;
- }
+ mAnimatedSize.width = mTargetSize.width;
+ mUseAnimatedSize |= AnimatedSizeFlag::WIDTH;
// Notify deriving classes
OnSizeAnimation( animation, mTargetSize );
{
if( AdjustValue< float >( mTargetSize.height, value ) )
{
- if( mRelayoutData && GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::FIXED )
- {
- mRelayoutData->preferredSize.height = mTargetSize.height;
- }
+ mAnimatedSize.height = mTargetSize.height;
+ mUseAnimatedSize |= AnimatedSizeFlag::HEIGHT;
// Notify deriving classes
OnSizeAnimation( animation, mTargetSize );
{
if( AdjustValue< float >( mTargetSize.depth, value ) )
{
+ mAnimatedSize.depth = mTargetSize.depth;
+ mUseAnimatedSize |= AnimatedSizeFlag::DEPTH;
+
// Notify deriving classes
OnSizeAnimation( animation, mTargetSize );
}
// A 0 width or height may also be required so if the resize policy has not been changed, i.e. is still set to DEFAULT,
// then change to FIXED as well
- if( size.width > 0.0f || GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::DEFAULT )
+ if( size.width > 0.0f )
{
SetResizePolicy( ResizePolicy::FIXED, Dimension::WIDTH );
}
- if( size.height > 0.0f || GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::DEFAULT )
+ if( size.height > 0.0f )
{
SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT );
}
mRelayoutData->preferredSize = size;
+ mUseAnimatedSize = AnimatedSizeFlag::CLEAR;
+
RelayoutRequest();
}