Fix text opacity issue 09/184409/1
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 18 Jul 2018 01:18:54 +0000 (10:18 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 18 Jul 2018 01:18:54 +0000 (10:18 +0900)
The renderer opacity value should be restored when the text opacity value is not zero.

Change-Id: Iff61b7e5665b3d083278d34fcb7701089cd48c91

automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
dali-toolkit/internal/visuals/text/text-visual.cpp

index db4f6bd..d5019bd 100644 (file)
@@ -1158,6 +1158,15 @@ int UtcDaliToolkitTextLabelColorComponents(void)
 
   DALI_TEST_EQUALS( drawTrace.FindMethod( "DrawArrays" ), false, TEST_LOCATION ); // Rendering should be skipped
 
 
   DALI_TEST_EQUALS( drawTrace.FindMethod( "DrawArrays" ), false, TEST_LOCATION ); // Rendering should be skipped
 
+  label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED );
+
+  drawTrace.Reset();
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( drawTrace.FindMethod( "DrawArrays" ), true, TEST_LOCATION ); // Should be rendered again
+
   END_TEST;
 }
 
   END_TEST;
 }
 
index c6309f1..b8edc7a 100755 (executable)
@@ -305,6 +305,10 @@ void OpacityConstraint( float& current, const PropertyInputContainer& inputs )
   {
     current = 0.0f;
   }
   {
     current = 0.0f;
   }
+  else
+  {
+    current = 1.0f;
+  }
 }
 
 } // unnamed namespace
 }
 
 } // unnamed namespace