- Constraint colorConstraint = Constraint::New<Vector4>(mImpl->mRenderer, shaderTextColorIndex, TextColorConstraint);
- colorConstraint.AddSource(Source(actor, mAnimatableTextColorPropertyIndex));
- colorConstraint.Apply();
-
- // Make zero if the alpha value of text color is zero to skip rendering text
- Constraint opacityConstraint = Constraint::New<float>(mImpl->mRenderer, Dali::DevelRenderer::Property::OPACITY, OpacityConstraint);
- opacityConstraint.AddSource(Source(actor, mAnimatableTextColorPropertyIndex));
- opacityConstraint.Apply();
+ if(!mColorConstraint)
+ {
+ mColorConstraint = Constraint::New<Vector4>(mImpl->mRenderer, mTextColorAnimatableIndex, TextColorConstraint);
+ mColorConstraint.AddSource(Source(actor, mAnimatableTextColorPropertyIndex));
+ }
+ mColorConstraint.Apply();