{
const std::string COLOR_KEY( "color" );
const std::string OFFSET_KEY( "offset" );
+const std::string BLUR_RADIUS_KEY( "blurRadius" );
const std::string WIDTH_KEY( "width" );
const std::string HEIGHT_KEY( "height" );
const std::string ENABLE_KEY( "enable" );
bool& colorDefined,
Vector4& color,
bool& offsetDefined,
- Vector2& offset )
+ Vector2& offset,
+ bool& blurRadiusDefined,
+ float& blurRadius )
{
const unsigned int numberOfItems = shadowPropertiesMap.Count();
/// Color key.
colorDefined = true;
- const std::string colorStr = valueGet.second.Get<std::string>();
-
- Text::ColorStringToVector4( colorStr.c_str(), colorStr.size(), color );
+ if( valueGet.second.GetType() == Dali::Property::STRING )
+ {
+ const std::string colorStr = valueGet.second.Get<std::string>();
+ Text::ColorStringToVector4( colorStr.c_str(), colorStr.size(), color );
+ }
+ else
+ {
+ color = valueGet.second.Get<Vector4>();
+ }
}
else if( OFFSET_KEY == valueGet.first.stringKey )
{
/// Offset key.
offsetDefined = true;
- const std::string offsetStr = valueGet.second.Get<std::string>();
+ if( valueGet.second.GetType() == Dali::Property::STRING )
+ {
+ const std::string offsetStr = valueGet.second.Get<std::string>();
+ StringToVector2( offsetStr.c_str(), offsetStr.size(), offset );
+ }
+ else
+ {
+ offset = valueGet.second.Get<Vector2>();
+ }
+ }
+ else if( BLUR_RADIUS_KEY == valueGet.first.stringKey )
+ {
+ /// Blur radius key.
+ blurRadiusDefined = true;
- StringToVector2( offsetStr.c_str(), offsetStr.size(), offset );
+ if( valueGet.second.GetType() == Dali::Property::STRING )
+ {
+ const std::string blurRadiusStr = valueGet.second.Get<std::string>();
+ blurRadius = StringToFloat( blurRadiusStr.c_str() );
+ }
+ else
+ {
+ blurRadius = valueGet.second.Get<float>();
+ }
}
}
Vector4 color;
bool offsetDefined = false;
Vector2 offset;
+ bool blurRadiusDefined = false;
+ float blurRadius;
bool empty = true;
colorDefined,
color,
offsetDefined,
- offset );
+ offset,
+ blurRadiusDefined,
+ blurRadius );
controller->ShadowSetByString( !empty );
colorDefined,
color,
offsetDefined,
- offset );
+ offset,
+ blurRadiusDefined,
+ blurRadius );
controller->ShadowSetByString( false );
}
controller->SetShadowOffset( offset );
update = true;
}
+
+ if( blurRadiusDefined && ( controller->GetShadowBlurRadius() != blurRadius ) )
+ {
+ controller->SetShadowBlurRadius( blurRadius );
+ update = true;
+ }
}
else
{
{
const Vector4& color = controller->GetShadowColor();
const Vector2& offset = controller->GetShadowOffset();
+ const float& blurRadius = controller->GetShadowBlurRadius();
if ( controller->IsShadowSetByString() )
{
std::string offsetStr;
Vector2ToString( offset, offsetStr );
- shadowProperties += "\"offset\":\"" + offsetStr + "\"}";
+ shadowProperties += "\"offset\":\"" + offsetStr + "\",";
+
+ std::string blurRadiusStr;
+ FloatToString( blurRadius, blurRadiusStr );
+ shadowProperties += "\"blurRadius\":\"" + blurRadiusStr + "\"}";
value = shadowProperties;
}
{
Property::Map map;
- std::string colorStr;
- Vector4ToColorString( color, colorStr );
- map.Insert( COLOR_KEY, colorStr );
-
- std::string offsetStr;
- Vector2ToString( offset, offsetStr );
- map.Insert( OFFSET_KEY, offsetStr );
+ map.Insert( COLOR_KEY, color );
+ map.Insert( OFFSET_KEY, offset );
+ map.Insert( BLUR_RADIUS_KEY, blurRadius );
value = map;
}
bool empty = true;
- if ( !propertiesMap.Empty() )
+ if ( propertiesMap.Empty() )
+ {
+ // Map empty so check if a string provided
+ // This is purely to maintain backward compatibility, but we don't parse the string to be a property map.
+ const std::string propertyString = value.Get<std::string>();
+
+ // Stores the default outline's properties string to be recovered by the GetOutlineProperties() function.
+ controller->SetDefaultOutlineProperties( propertyString );
+
+ controller->OutlineSetByString( true );
+ }
+ else
{
empty = ParseOutlineProperties( propertiesMap,
colorDefined,
color,
widthDefined,
width );
+
+ controller->OutlineSetByString( false );
}
if( !empty )
{
case EffectStyle::DEFAULT:
{
- const Vector4& color = controller->GetOutlineColor();
- const float width = controller->GetOutlineWidth();
+ if ( controller->IsOutlineSetByString() )
+ {
+ value = controller->GetDefaultOutlineProperties();
+ break;
+ }
+ else
+ {
+ const Vector4& color = controller->GetOutlineColor();
+ const float width = controller->GetOutlineWidth();
- Property::Map map;
+ Property::Map map;
- std::string colorStr;
- Vector4ToColorString( color, colorStr );
- map.Insert( COLOR_KEY, colorStr );
+ std::string colorStr;
+ Vector4ToColorString( color, colorStr );
+ map.Insert( COLOR_KEY, colorStr );
- std::string widthStr;
- FloatToString( width, widthStr );
- map.Insert( WIDTH_KEY, widthStr );
+ std::string widthStr;
+ FloatToString( width, widthStr );
+ map.Insert( WIDTH_KEY, widthStr );
- value = map;
+ value = map;
- break;
+ break;
+ }
}
case EffectStyle::INPUT:
{