X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Ftext%2Ftext-visual.cpp;h=eb2dc0480f3779dd799c99ad1a0b95ec9e858ac4;hp=e894d2b37403ecf39c76e49670b71fca0880a084;hb=c5e264bdf15b0a9fe1ef0c622b2f75dec6fd6168;hpb=db345a276572844ef456bff2339cfc3143a46991 diff --git a/dali-toolkit/internal/visuals/text/text-visual.cpp b/dali-toolkit/internal/visuals/text/text-visual.cpp index e894d2b..eb2dc04 100755 --- a/dali-toolkit/internal/visuals/text/text-visual.cpp +++ b/dali-toolkit/internal/visuals/text/text-visual.cpp @@ -151,7 +151,7 @@ const char* FRAGMENT_SHADER_SINGLE_COLOR_TEXT_WITH_STYLE = DALI_COMPOSE_SHADER( mediump vec4 styleTexture = texture2D( sStyle, vTexCoord );\n // Draw the text as overlay above the style - gl_FragColor = ( uTextColorAnimatable * textTexture + styleTexture * ( 1.0 - textTexture ) ) * uColor * vec4( mixColor, 1.0 );\n + gl_FragColor = ( uTextColorAnimatable * textTexture + styleTexture * ( 1.0 - uTextColorAnimatable.a * textTexture ) ) * uColor * vec4( mixColor, 1.0 );\n }\n ); @@ -297,6 +297,15 @@ Dali::Property::Index StringKeyToIndexKey( const std::string& stringKey ) return result; } +void TextColorConstraint( Vector4& current, const PropertyInputContainer& inputs ) +{ + Vector4 color = inputs[0]->GetVector4(); + current.r = color.r * color.a; + current.g = color.g * color.a; + current.b = color.b * color.a; + current.a = color.a; +} + void OpacityConstraint( float& current, const PropertyInputContainer& inputs ) { current = inputs[0]->GetVector4().a; @@ -453,7 +462,7 @@ void TextVisual::DoSetOnStage( Actor& actor ) // Create constraint for the animatable text's color Property with uTextColorAnimatable in the renderer. if( shaderTextColorIndex != Property::INVALID_INDEX ) { - Constraint colorConstraint = Constraint::New( mImpl->mRenderer, shaderTextColorIndex, EqualToConstraint() ); + Constraint colorConstraint = Constraint::New( mImpl->mRenderer, shaderTextColorIndex, TextColorConstraint ); colorConstraint.AddSource( Source( actor, mAnimatableTextColorPropertyIndex ) ); colorConstraint.Apply();