[4.0] Don't render text visual if the string is empty or the color is transparent 13/165313/1
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 27 Dec 2017 06:40:53 +0000 (15:40 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Thu, 28 Dec 2017 06:27:26 +0000 (15:27 +0900)
Change-Id: I1da1b0e243b645ad3a8b5e9ce558b81d82f07186

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

index 621f175..fb45b54 100755 (executable)
@@ -35,6 +35,7 @@
 #include <dali-toolkit/internal/text/text-effects-style.h>
 #include <dali-toolkit/internal/text/script-run.h>
 #include <dali-toolkit/internal/text/text-enumerations-impl.h>
+#include <dali-toolkit/internal/text/rendering/view-model.h>
 
 namespace Dali
 {
@@ -638,7 +639,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 ) );
 
-  if( ( fabsf( relayoutSize.width ) < Math::MACHINE_EPSILON_1000 ) || ( fabsf( relayoutSize.height ) < Math::MACHINE_EPSILON_1000 ) )
+  float alpha = control.GetProperty< float >( Actor::Property::COLOR_ALPHA );
+  Vector4 animatableTextColor = control.GetProperty< Vector4 >( mAnimatableTextColorPropertyIndex );
+  if( ( fabsf( relayoutSize.width ) < Math::MACHINE_EPSILON_1000 ) || ( fabsf( relayoutSize.height ) < Math::MACHINE_EPSILON_1000 )
+      || mTypesetter->GetViewModel()->GetNumberOfLines() == 0 || alpha == 0.0f || animatableTextColor.a == 0.0f )
   {
     // Removes the texture set.
     RemoveTextureSet();