Don't render text visual if the string is empty 22/165222/4
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 27 Dec 2017 06:40:53 +0000 (15:40 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Thu, 11 Jan 2018 01:26:36 +0000 (10:26 +0900)
Change-Id: I1da1b0e243b645ad3a8b5e9ce558b81d82f07186

dali-toolkit/internal/visuals/text/text-visual.cpp

index 746fe28..09d0c0a 100755 (executable)
@@ -630,7 +630,10 @@ void TextVisual::UpdateRenderer()
   relayoutSize.width = floorf( 0.5f + ( isWidthRelative ? mImpl->mControlSize.width * mImpl->mTransform.mSize.x : mImpl->mTransform.mSize.width ) );
   relayoutSize.height = floorf( 0.5f + ( isHeightRelative ? mImpl->mControlSize.height * mImpl->mTransform.mSize.y : mImpl->mTransform.mSize.height ) );
 
   relayoutSize.width = floorf( 0.5f + ( isWidthRelative ? mImpl->mControlSize.width * mImpl->mTransform.mSize.x : mImpl->mTransform.mSize.width ) );
   relayoutSize.height = floorf( 0.5f + ( isHeightRelative ? mImpl->mControlSize.height * mImpl->mTransform.mSize.y : mImpl->mTransform.mSize.height ) );
 
-  if( ( fabsf( relayoutSize.width ) < Math::MACHINE_EPSILON_1000 ) || ( fabsf( relayoutSize.height ) < Math::MACHINE_EPSILON_1000 ) )
+  std::string text;
+  mController->GetText( text );
+
+  if( ( fabsf( relayoutSize.width ) < Math::MACHINE_EPSILON_1000 ) || ( fabsf( relayoutSize.height ) < Math::MACHINE_EPSILON_1000 ) || text.empty() )
   {
     // Removes the texture set.
     RemoveTextureSet();
   {
     // Removes the texture set.
     RemoveTextureSet();