From 239a4d5e714824b9ba72abc3c3db2fd4330c0632 Mon Sep 17 00:00:00 2001 From: "minho.sun" Date: Wed, 3 Jan 2018 21:55:12 +0900 Subject: [PATCH] [4.0] Fix UpdateRender if statement. Currently, TextVisual makes crash when doing UpdateRender because mAnimatableTextColorPropertyIndex is set to Property::INVALID_INDEX and this property only can be set by TextLabel. TextVisual can be exist in other control like Buttons so change if statement which uses mAnimatableTextColorPropertyIndex to get alpha value. Change-Id: I5ea04461584126e69490ccc513434200f5751755 Signed-off-by: minho.sun --- dali-toolkit/internal/visuals/text/text-visual.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dali-toolkit/internal/visuals/text/text-visual.cpp b/dali-toolkit/internal/visuals/text/text-visual.cpp index fb45b54..faa0927 100755 --- a/dali-toolkit/internal/visuals/text/text-visual.cpp +++ b/dali-toolkit/internal/visuals/text/text-visual.cpp @@ -640,7 +640,12 @@ void TextVisual::UpdateRenderer() relayoutSize.height = floorf( 0.5f + ( isHeightRelative ? mImpl->mControlSize.height * mImpl->mTransform.mSize.y : mImpl->mTransform.mSize.height ) ); float alpha = control.GetProperty< float >( Actor::Property::COLOR_ALPHA ); - Vector4 animatableTextColor = control.GetProperty< Vector4 >( mAnimatableTextColorPropertyIndex ); + Vector4 animatableTextColor = Color::WHITE; + if( mAnimatableTextColorPropertyIndex != Property::INVALID_INDEX ) + { + 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 ) { -- 2.7.4