Fix mControlBackgroundEnabled changes when background visual does not exist 69/316269/2
authorANZ1217 <chihun.jeong@samsung.com>
Thu, 12 Dec 2024 07:48:26 +0000 (16:48 +0900)
committerANZ1217 <chihun.jeong@samsung.com>
Thu, 12 Dec 2024 07:50:49 +0000 (16:50 +0900)
Change-Id: I511019b34d91e9c5565e12d23f85237e43743e87

dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.h

index 69dfb8af8a93b8f1919f401f9945d67a11538a0a..07a553a66765814086c4c6844ef3611e19f46f57 100644 (file)
@@ -1784,7 +1784,7 @@ TextLabel::TextLabel(ControlBehaviour additionalBehaviour)
   mAsyncLineCount(0),
   mTextUpdateNeeded(false),
   mLastAutoScrollEnabled(false),
-  mControlBackgroundEnabeld(true),
+  mControlBackgroundEnabled(true),
   mIsAsyncRenderNeeded(false),
   mIsSizeChanged(false),
   mIsManualRender(false),
@@ -1882,9 +1882,14 @@ bool TextLabel::IsRemoveBackInset() const
 void TextLabel::EnableControlBackground(const bool enable)
 {
   // Avoid function calls if there is no change.
-  if(mControlBackgroundEnabeld != enable)
+  if(!DevelControl::GetVisual(*this, Toolkit::Control::Property::BACKGROUND))
   {
-    mControlBackgroundEnabeld = enable;
+    return;
+  }
+
+  if(mControlBackgroundEnabled != enable)
+  {
+    mControlBackgroundEnabled = enable;
     DevelControl::EnableVisual(*this, Toolkit::Control::Property::BACKGROUND, enable);
   }
 }
index ddd6e482f59aee64e60a2ed00c826efd48754a1c..8b74d39e2b7cc93aa2fee24a88de7a1824f9cdd3 100644 (file)
@@ -492,7 +492,7 @@ private: // Data
   int  mAsyncLineCount;
   bool mTextUpdateNeeded         : 1;
   bool mLastAutoScrollEnabled    : 1;
-  bool mControlBackgroundEnabeld : 1;
+  bool mControlBackgroundEnabled : 1;
 
   bool mIsAsyncRenderNeeded : 1; // true if a render request is required in ASYNC_AUTO mode, otherwise false.
   bool mIsSizeChanged       : 1; // whether the size has been changed or not.