[NUI] Do not recreate visual when we change ImageColor only
authorEunki Hong <eunkiki.hong@samsung.com>
Wed, 3 Jan 2024 16:44:02 +0000 (01:44 +0900)
committerEunki Hong <h.pichulia@gmail.com>
Fri, 5 Jan 2024 07:17:57 +0000 (16:17 +0900)
Since we don't need to re-create the visual if we only chage the ImageColor property,
let we use UpdateProperty Action.

Signed-off-by: Eunki Hong <eunkiki.hong@samsung.com>
src/Tizen.NUI/src/public/BaseComponents/ImageView.cs
src/Tizen.NUI/src/public/BaseComponents/ImageViewBindableProperty.cs

index 0611ba1..6d469a8 100755 (executable)
@@ -1634,7 +1634,7 @@ namespace Tizen.NUI.BaseComponents
                         }
                     }
                 }
-                imagePropertyUpdatedFlag = true;
+                imagePropertyUpdatedFlag |= requiredVisualCreation;
                 cachedImagePropertyMap[key] = value;
 
                 // Lazy update only if visual creation required, and _resourceUrl is not empty, and ProcessAttachedFlag is false.
index ab6e689..05b6a59 100755 (executable)
@@ -581,7 +581,10 @@ namespace Tizen.NUI.BaseComponents
             if (newValue != null)
             {
                 imageView.UpdateImage(Visual.Property.Opacity, new PropertyValue(((Color)newValue).A), false);
-                imageView.UpdateImage(Visual.Property.MixColor, new PropertyValue((Color)newValue));
+                imageView.UpdateImage(Visual.Property.MixColor, new PropertyValue((Color)newValue), false);
+
+                // Update property
+                Interop.View.InternalUpdateVisualPropertyVector4(imageView.SwigCPtr, ImageView.Property.IMAGE, Visual.Property.MixColor, Vector4.getCPtr((Color)newValue));
             }
         },
         defaultValueCreator: (bindable) =>