From: Joogab Yun Date: Wed, 16 Sep 2020 06:22:08 +0000 (+0900) Subject: Add null check for mTextureSet. X-Git-Tag: dali_1.9.31~6^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=0e1683ef848d1d877e26633609fa95e0d2ab36b5;hp=7b49f95b6d22be04ef9a3320eaaae7dc3e63ec46;ds=inline Add null check for mTextureSet. For empty text, text-visual doesn't create a textureSet. So it happens that mTextureSet is null. (sample) void Create(Application& application) { // Get a handle to the window Window window = application.GetWindow(); window.SetBackgroundColor(Color::WHITE); textLabel = TextLabel::New(); textLabel.SetProperty( Actor::Property::SIZE, Vector2(300.f, 200.f)); textLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, "" ); textLabel.SetProperty( Toolkit::TextLabel::Property::ENABLE_AUTO_SCROLL, true ); window.Add(textLabel); // Respond to a touch anywhere on the window window.GetRootLayer().TouchedSignal().Connect(this, &HelloWorldController::OnTouch); } bool OnTouch(Actor actor, const TouchEvent& touch) { textLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, "" ); textLabel.SetProperty( Toolkit::TextLabel::Property::ENABLE_AUTO_SCROLL, false ); return true; } Change-Id: Iff50abb0278c7d2f650a8c92cf8d5c5eaec6f36a --- diff --git a/dali-toolkit/internal/text/text-scroller.cpp b/dali-toolkit/internal/text/text-scroller.cpp old mode 100644 new mode 100755 index 22f1156..6d0930b --- a/dali-toolkit/internal/text/text-scroller.cpp +++ b/dali-toolkit/internal/text/text-scroller.cpp @@ -271,7 +271,10 @@ void TextScroller::SetParameters( Actor scrollingTextActor, Renderer renderer, T // Reset to the original shader and texture before scrolling mRenderer.SetShader(mShader); - mRenderer.SetTextures( mTextureSet ); + if( mTextureSet ) + { + mRenderer.SetTextures( mTextureSet ); + } } mShader = mRenderer.GetShader();