Fix to allow Actor::COLOR property to change text color 57/122857/2
authorVictor Cebollada <v.cebollada@samsung.com>
Mon, 3 Apr 2017 16:00:02 +0000 (17:00 +0100)
committerPaul Wisbey <p.wisbey@samsung.com>
Mon, 3 Apr 2017 18:05:13 +0000 (11:05 -0700)
Disclaimer - Actor::COLOR will also affect the background color (if any SetBackground API is used)

Change-Id: I4e7ed501759e6c2f2a5876e95a6bc676bbf81880
Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp

index 0136a05..5322568 100644 (file)
@@ -450,6 +450,7 @@ struct AtlasRenderer::Impl
         mActor.SetParentOrigin( ParentOrigin::TOP_LEFT );
         mActor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
         mActor.SetSize( textSize );
+        mActor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR );
       }
 
       for( std::vector< MeshRecord >::iterator it = meshContainer.begin(),
@@ -566,17 +567,18 @@ struct AtlasRenderer::Impl
     renderer.SetTextures( textureSet );
     renderer.SetProperty( Dali::Renderer::Property::BLEND_MODE, BlendMode::ON );
     renderer.SetProperty( Dali::Renderer::Property::DEPTH_INDEX, DepthIndex::CONTENT + mDepth );
+
     Actor actor = Actor::New();
 #if defined(DEBUG_ENABLED)
     actor.SetName( "Text renderable actor" );
 #endif
     actor.AddRenderer( renderer );
-
     // Keep all of the origins aligned
     actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
     actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
     actor.SetSize( actorSize );
     actor.RegisterProperty("uOffset", Vector2::ZERO );
+    actor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR );
     return actor;
   }