Commit 11878e748d82eb6335d6ab537527765710086574

Authored by Eunki, Hong
1 parent 14041a85

Corner Radius become Vector4

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
@@ -27,14 +27,15 @@ namespace @@ -27,14 +27,15 @@ namespace
27 { 27 {
28 const char* IMAGE_FILE(DEMO_IMAGE_DIR "gallery-medium-1.jpg"); 28 const char* IMAGE_FILE(DEMO_IMAGE_DIR "gallery-medium-1.jpg");
29 29
30 -const float CORNER_RADIUS_VALUE(30.0f);  
31 -  
32 const float BLUR_RADIUS_VALUE(15.0f); 30 const float BLUR_RADIUS_VALUE(15.0f);
33 const Vector2 BLUR_OFFSET_VALUE(0.05f, 0.05f); 31 const Vector2 BLUR_OFFSET_VALUE(0.05f, 0.05f);
34 const Vector2 BLUR_SIZE_VALUE(1.1f, 1.1f); 32 const Vector2 BLUR_SIZE_VALUE(1.1f, 1.1f);
35 const Vector2 NO_BLUR_SIZE_VALUE(1.05f, 1.05f); 33 const Vector2 NO_BLUR_SIZE_VALUE(1.05f, 1.05f);
36 const float ANIMATION_DURATION(2.0f); 34 const float ANIMATION_DURATION(2.0f);
37 35
  36 +constexpr Vector4 CORNER_RADIUS_VALUE(30.0f, 30.0f, 30.0f, 30.0f);
  37 +constexpr Vector4 SHADOW_CORNER_RADIUS_VALUE(33.0f, 33.0f, 33.0f, 33.0f);
  38 +
38 const Property::Value SHADOW{ 39 const Property::Value SHADOW{
39 {Visual::Property::TYPE, Visual::COLOR}, 40 {Visual::Property::TYPE, Visual::COLOR},
40 {Visual::Property::MIX_COLOR, Vector4(0.0f, 0.0f, 0.0f, 0.5f)}, 41 {Visual::Property::MIX_COLOR, Vector4(0.0f, 0.0f, 0.0f, 0.5f)},
@@ -96,7 +97,7 @@ public: @@ -96,7 +97,7 @@ public:
96 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, ImageView::Property::IMAGE, Visual::Property::OPACITY), 0.5f); 97 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, ImageView::Property::IMAGE, Visual::Property::OPACITY), 0.5f);
97 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, ImageView::Property::IMAGE, DevelVisual::Property::CORNER_RADIUS), CORNER_RADIUS_VALUE); 98 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, ImageView::Property::IMAGE, DevelVisual::Property::CORNER_RADIUS), CORNER_RADIUS_VALUE);
98 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, ColorVisual::Property::MIX_COLOR), Vector3(0.0f, 0.0f, 1.0f)); 99 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, ColorVisual::Property::MIX_COLOR), Vector3(0.0f, 0.0f, 1.0f));
99 - animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, DevelVisual::Property::CORNER_RADIUS), CORNER_RADIUS_VALUE * BLUR_SIZE_VALUE.x / NO_BLUR_SIZE_VALUE.x); 100 + animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, DevelVisual::Property::CORNER_RADIUS), SHADOW_CORNER_RADIUS_VALUE);
100 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, DevelColorVisual::Property::BLUR_RADIUS), BLUR_RADIUS_VALUE); 101 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, DevelColorVisual::Property::BLUR_RADIUS), BLUR_RADIUS_VALUE);
101 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, Visual::Transform::Property::OFFSET), BLUR_OFFSET_VALUE); 102 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, Visual::Transform::Property::OFFSET), BLUR_OFFSET_VALUE);
102 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, Visual::Transform::Property::SIZE), BLUR_SIZE_VALUE); 103 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, Visual::Transform::Property::SIZE), BLUR_SIZE_VALUE);
@@ -105,9 +106,9 @@ public: @@ -105,9 +106,9 @@ public:
105 { 106 {
106 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, ImageView::Property::IMAGE, Visual::Property::MIX_COLOR), Vector3(1.0f, 1.0f, 1.0f)); 107 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, ImageView::Property::IMAGE, Visual::Property::MIX_COLOR), Vector3(1.0f, 1.0f, 1.0f));
107 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, ImageView::Property::IMAGE, Visual::Property::OPACITY), 1.0f); 108 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, ImageView::Property::IMAGE, Visual::Property::OPACITY), 1.0f);
108 - animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, ImageView::Property::IMAGE, DevelVisual::Property::CORNER_RADIUS), 0.0f); 109 + animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, ImageView::Property::IMAGE, DevelVisual::Property::CORNER_RADIUS), Vector4::ZERO);
109 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, ColorVisual::Property::MIX_COLOR), Vector3(0.0f, 0.0f, 0.0f)); 110 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, ColorVisual::Property::MIX_COLOR), Vector3(0.0f, 0.0f, 0.0f));
110 - animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, DevelVisual::Property::CORNER_RADIUS), 0.0f); 111 + animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, DevelVisual::Property::CORNER_RADIUS), Vector4::ZERO);
111 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, DevelColorVisual::Property::BLUR_RADIUS), 0.0f); 112 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, DevelColorVisual::Property::BLUR_RADIUS), 0.0f);
112 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, Visual::Transform::Property::OFFSET), Vector2::ZERO); 113 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, Visual::Transform::Property::OFFSET), Vector2::ZERO);
113 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, Visual::Transform::Property::SIZE), NO_BLUR_SIZE_VALUE); 114 animation.AnimateTo(DevelControl::GetVisualProperty(mImageView, DevelControl::Property::SHADOW, Visual::Transform::Property::SIZE), NO_BLUR_SIZE_VALUE);
examples/gradients/gradients-example.cpp
@@ -33,7 +33,7 @@ const char* const CHANGE_ICON_SELECTED(DEMO_IMAGE_DIR &quot;icon-change-selected.png&quot; @@ -33,7 +33,7 @@ const char* const CHANGE_ICON_SELECTED(DEMO_IMAGE_DIR &quot;icon-change-selected.png&quot;
33 const char* const ROUNDED_CORNER_ICON(DEMO_IMAGE_DIR "icon-replace.png"); 33 const char* const ROUNDED_CORNER_ICON(DEMO_IMAGE_DIR "icon-replace.png");
34 const char* const ROUNDED_CORNER_ICON_SELECTED(DEMO_IMAGE_DIR "icon-replace-selected.png"); 34 const char* const ROUNDED_CORNER_ICON_SELECTED(DEMO_IMAGE_DIR "icon-replace-selected.png");
35 35
36 -const float CORNER_RADIUS_VALUE(20.0f); 36 +constexpr Vector4 CORNER_RADIUS_VALUE(20.0f, 20.0f, 20.0f, 20.0f);
37 37
38 } // namespace 38 } // namespace
39 39
@@ -119,7 +119,7 @@ public: @@ -119,7 +119,7 @@ public:
119 stopColors.PushBack(Color::YELLOW); 119 stopColors.PushBack(Color::YELLOW);
120 mGradientMap.Insert(GradientVisual::Property::STOP_COLOR, stopColors); 120 mGradientMap.Insert(GradientVisual::Property::STOP_COLOR, stopColors);
121 121
122 - mGradientMap.Insert(DevelVisual::Property::CORNER_RADIUS, mRoundedCorner ? CORNER_RADIUS_VALUE : 0.0f); 122 + mGradientMap.Insert(DevelVisual::Property::CORNER_RADIUS, mRoundedCorner ? CORNER_RADIUS_VALUE : Vector4::ZERO);
123 123
124 UpdateGradientMap(); 124 UpdateGradientMap();
125 } 125 }
@@ -142,7 +142,7 @@ public: @@ -142,7 +142,7 @@ public:
142 } 142 }
143 else 143 else
144 { 144 {
145 - animation.AnimateTo(DevelControl::GetVisualProperty(mGradientControl, Control::Property::BACKGROUND, DevelVisual::Property::CORNER_RADIUS), 0.0f); 145 + animation.AnimateTo(DevelControl::GetVisualProperty(mGradientControl, Control::Property::BACKGROUND, DevelVisual::Property::CORNER_RADIUS), Vector4::ZERO);
146 } 146 }
147 animation.Play(); 147 animation.Play();
148 148