/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
imageActor.SetPosition(0.0f, 0.0f, 0.0f);
Vector3 imageSize = imageActor.GetCurrentSize();
- DALI_TEST_EQUALS( imageSize, Vector3(width, height, std::min(width, height)), TEST_LOCATION);
+ DALI_TEST_EQUALS( imageSize, Vector3(width, height, 0), TEST_LOCATION);
drawTrace.Reset();
imageActor.SetParentOrigin(ParentOrigin::TOP_LEFT);
ImageActor imageActor = CreateOnStageActor(application, image, width, height, true);
Vector3 imageSize = imageActor.GetCurrentSize();
- DALI_TEST_EQUALS( imageSize, Vector3(width, height, std::min(width, height)), TEST_LOCATION);
+ DALI_TEST_EQUALS( imageSize, Vector3(width, height, 0), TEST_LOCATION);
imageSize.z = 0.0f;
float radius = imageSize.Length() * 0.5f; // Radius of bounding box
ImageActor imageActor = CreateOnStageActor(application, image, width, height, true);
Vector3 imageSize = imageActor.GetCurrentSize();
- DALI_TEST_EQUALS( imageSize, Vector3(width, height, std::min(width, height)), TEST_LOCATION);
+ DALI_TEST_EQUALS( imageSize, Vector3(width, height, 0), TEST_LOCATION);
imageSize.z = 0.0f;
tet_printf("Testing Stage Size: (%3.0f, %3.0f) image size:(%3.0f, %3.0f) \n",
ImageActor imageActor = CreateOnStageActor(application, image, width, height, true);
Vector3 imageSize = imageActor.GetCurrentSize();
- DALI_TEST_EQUALS( imageSize, Vector3(width, height, std::min(width, height)), TEST_LOCATION);
+ DALI_TEST_EQUALS( imageSize, Vector3(width, height, 0), TEST_LOCATION);
imageSize.z = 0.0f;
float radius = imageSize.Length() * 0.5f; // Radius of bounding box
ImageActor imageActor = CreateOnStageActor(application, image, width, height, true);
Vector3 imageSize = imageActor.GetCurrentSize();
- DALI_TEST_EQUALS( imageSize, Vector3(width, height, std::min(width, height)), TEST_LOCATION);
+ DALI_TEST_EQUALS( imageSize, Vector3(width, height, 0), TEST_LOCATION);
imageSize.z = 0.0f;
tet_printf("Testing Stage Size: (%3.0f, %3.0f) image size:(%3.0f, %3.0f)\n",
ImageActor imageActor = CreateOnStageActor(application, image, width, height, true);
Vector3 imageSize = imageActor.GetCurrentSize();
- DALI_TEST_EQUALS( imageSize, Vector3(width, height, std::min(width, height)), TEST_LOCATION);
+ DALI_TEST_EQUALS( imageSize, Vector3(width, height, 0), TEST_LOCATION);
imageSize.z = 0.0f;
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
TestApplication application;
Actor actor = Actor::New();
- Vector3 vector(100.0f, 100.0f, 100.0f);
+ Vector3 vector(100.0f, 100.0f, 0.0f);
DALI_TEST_CHECK(vector != actor.GetCurrentSize());
TestApplication application;
Actor actor = Actor::New();
- Vector3 vector(100.0f, 100.0f, 100.0f);
+ Vector3 vector(100.0f, 100.0f, 0.0f);
DALI_TEST_CHECK(vector != actor.GetCurrentSize());
void Actor::SetSize( const Vector2& size )
{
- SetSize( Vector3( size.width, size.height, CalculateSizeZ( size ) ) );
+ SetSize( Vector3( size.width, size.height, 0.f ) );
}
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 );
+ SetSizeInternal( Vector3( size.width, size.height, 0.f ) );
}
void Actor::SetSize( const Vector3& size )
{
if( IsRelayoutEnabled() && !mRelayoutData->insideRelayout )
{
+ // TODO we cannot just ignore the given Z but that means rewrite the size negotiation!!
SetPreferredSize( size.GetVectorXY() );
}
else
{
if ( mRelayoutData )
{
- return mRelayoutData->preferredSize;
+ return Vector2( mRelayoutData->preferredSize );
}
return GetDefaultPreferredSize();