Fix const table size bug in button + Erase annoying message 87/267587/2
authorEunki, Hong <eunkiki.hong@samsung.com>
Tue, 7 Dec 2021 11:37:48 +0000 (20:37 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Tue, 14 Dec 2021 03:31:30 +0000 (12:31 +0900)
Fix unmatched const static table value in button-impl.cpp
+
Remove annoying error message when we change button visual

Change-Id: I97acc25b73395799bef46a03a09739a6708359da
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali-toolkit/internal/controls/buttons/button-impl.cpp
dali-toolkit/internal/visuals/image/image-visual.cpp

index 70e9c76..7ff5875 100644 (file)
@@ -111,7 +111,7 @@ const Scripting::StringEnum ALIGNMENT_STRING_TABLE[] =
 
 const unsigned int ALIGNMENT_STRING_TABLE_COUNT = sizeof(ALIGNMENT_STRING_TABLE) / sizeof(ALIGNMENT_STRING_TABLE[0]);
 
-const Property::Index VISUAL_INDEX_FOR_STATE[][Button::STATE_COUNT] =
+const Property::Index VISUAL_INDEX_FOR_STATE[Button::STATE_COUNT][Button::VISUAL_STATE_COUNT] =
   {
     {Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, Toolkit::Button::Property::UNSELECTED_VISUAL},
     {Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, Toolkit::Button::Property::SELECTED_VISUAL},
index 650c508..b798e57 100644 (file)
@@ -477,7 +477,7 @@ void ImageVisual::GetNaturalSize(Vector2& naturalSize)
     }
 
     auto textureSet = mImpl->mRenderer.GetTextures();
-    if(textureSet)
+    if(textureSet && textureSet.GetTextureCount())
     {
       auto texture = textureSet.GetTexture(0);
       if(texture)