Corner Radius become Vector4 40/255340/3
authorEunki, Hong <eunkiki.hong@samsung.com>
Wed, 17 Mar 2021 06:08:35 +0000 (15:08 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Thu, 8 Apr 2021 05:02:24 +0000 (14:02 +0900)
sync with dali-toolkit refs/changes/75/255275/12

Change-Id: I9f364e2300aee0ac320e830f7c0ae5af155c4f34
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
examples/color-visual/color-visual-example.cpp
examples/gradients/gradients-example.cpp

index abca5fd..ca2f9d7 100644 (file)
@@ -27,14 +27,15 @@ namespace
 {
 const char* IMAGE_FILE(DEMO_IMAGE_DIR "gallery-medium-1.jpg");
 
-const float   CORNER_RADIUS_VALUE(30.0f);
-
 const float   BLUR_RADIUS_VALUE(15.0f);
 const Vector2 BLUR_OFFSET_VALUE(0.05f, 0.05f);
 const Vector2 BLUR_SIZE_VALUE(1.1f, 1.1f);
 const Vector2 NO_BLUR_SIZE_VALUE(1.05f, 1.05f);
 const float   ANIMATION_DURATION(2.0f);
 
+constexpr Vector4 CORNER_RADIUS_VALUE(30.0f, 30.0f, 30.0f, 30.0f);
+constexpr Vector4 SHADOW_CORNER_RADIUS_VALUE(33.0f, 33.0f, 33.0f, 33.0f);
+
 const Property::Value SHADOW{
   {Visual::Property::TYPE, Visual::COLOR},
   {Visual::Property::MIX_COLOR, Vector4(0.0f, 0.0f, 0.0f, 0.5f)},
@@ -96,7 +97,7 @@ public:
         animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, ImageView::Property::IMAGE, Visual::Property::OPACITY), 0.5f);
         animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, ImageView::Property::IMAGE, DevelVisual::Property::CORNER_RADIUS), CORNER_RADIUS_VALUE);
         animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, ColorVisual::Property::MIX_COLOR), Vector3(0.0f, 0.0f, 1.0f));
-        animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, DevelVisual::Property::CORNER_RADIUS), CORNER_RADIUS_VALUE * BLUR_SIZE_VALUE.x / NO_BLUR_SIZE_VALUE.x);
+        animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, DevelVisual::Property::CORNER_RADIUS), SHADOW_CORNER_RADIUS_VALUE);
         animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, DevelColorVisual::Property::BLUR_RADIUS), BLUR_RADIUS_VALUE);
         animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, Visual::Transform::Property::OFFSET), BLUR_OFFSET_VALUE);
         animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, Visual::Transform::Property::SIZE), BLUR_SIZE_VALUE);
@@ -105,9 +106,9 @@ public:
       {
         animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, ImageView::Property::IMAGE, Visual::Property::MIX_COLOR), Vector3(1.0f, 1.0f, 1.0f));
         animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, ImageView::Property::IMAGE, Visual::Property::OPACITY), 1.0f);
-        animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, ImageView::Property::IMAGE, DevelVisual::Property::CORNER_RADIUS), 0.0f);
+        animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, ImageView::Property::IMAGE, DevelVisual::Property::CORNER_RADIUS), Vector4::ZERO);
         animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, ColorVisual::Property::MIX_COLOR), Vector3(0.0f, 0.0f, 0.0f));
-        animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, DevelVisual::Property::CORNER_RADIUS), 0.0f);
+        animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, DevelVisual::Property::CORNER_RADIUS), Vector4::ZERO);
         animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, DevelColorVisual::Property::BLUR_RADIUS), 0.0f);
         animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, Visual::Transform::Property::OFFSET), Vector2::ZERO);
         animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, Visual::Transform::Property::SIZE), NO_BLUR_SIZE_VALUE);
index 77abb2c..5d57114 100644 (file)
@@ -33,7 +33,7 @@ const char* const CHANGE_ICON_SELECTED(DEMO_IMAGE_DIR "icon-change-selected.png"
 const char* const ROUNDED_CORNER_ICON(DEMO_IMAGE_DIR "icon-replace.png");
 const char* const ROUNDED_CORNER_ICON_SELECTED(DEMO_IMAGE_DIR "icon-replace-selected.png");
 
-const float CORNER_RADIUS_VALUE(20.0f);
+constexpr Vector4 CORNER_RADIUS_VALUE(20.0f, 20.0f, 20.0f, 20.0f);
 
 } // namespace
 
@@ -119,7 +119,7 @@ public:
     stopColors.PushBack(Color::YELLOW);
     mGradientMap.Insert(GradientVisual::Property::STOP_COLOR, stopColors);
 
-    mGradientMap.Insert(DevelVisual::Property::CORNER_RADIUS, mRoundedCorner ? CORNER_RADIUS_VALUE : 0.0f);
+    mGradientMap.Insert(DevelVisual::Property::CORNER_RADIUS, mRoundedCorner ? CORNER_RADIUS_VALUE : Vector4::ZERO);
 
     UpdateGradientMap();
   }
@@ -142,7 +142,7 @@ public:
     }
     else
     {
-      animation.AnimateTo(DevelControl::GetVisualProperty(mGradientControl, Control::Property::BACKGROUND, DevelVisual::Property::CORNER_RADIUS), 0.0f);
+      animation.AnimateTo(DevelControl::GetVisualProperty(mGradientControl, Control::Property::BACKGROUND, DevelVisual::Property::CORNER_RADIUS), Vector4::ZERO);
     }
     animation.Play();