ColorVisual can use both BLUR_RADIUS and CORNER_RADIUS 96/253896/2
authorEunki, Hong <eunkiki.hong@samsung.com>
Fri, 19 Feb 2021 06:12:18 +0000 (15:12 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Tue, 30 Mar 2021 06:06:22 +0000 (15:06 +0900)
sample demo code about refs/changes/80/252080/9
(review.tizen.org/gerrit/#/c/platform/core/uifw/dali-toolkit/+/252080)

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

index 10e71e7..abca5fd 100644 (file)
@@ -27,6 +27,8 @@ 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);
@@ -92,8 +94,9 @@ public:
       {
         animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, ImageView::Property::IMAGE, Visual::Property::MIX_COLOR), Vector3(1.0f, 0.0f, 0.0f));
         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), 30.0f);
+        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, 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);
@@ -104,6 +107,7 @@ public:
         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, 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, 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);