if( ENABLE_KEY == valueGet.first.stringKey )
{
/// Enable key.
- const std::string enableStr = valueGet.second.Get<std::string>();
- enabled = Text::TokenComparison( TRUE_TOKEN, enableStr.c_str(), enableStr.size() );
+ if( valueGet.second.GetType() == Dali::Property::STRING )
+ {
+ const std::string enableStr = valueGet.second.Get<std::string>();
+ enabled = Text::TokenComparison( TRUE_TOKEN, enableStr.c_str(), enableStr.size() );
+ }
+ else
+ {
+ enabled = valueGet.second.Get<bool>();
+ }
}
else if( COLOR_KEY == valueGet.first.stringKey )
{
/// 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( HEIGHT_KEY == valueGet.first.stringKey )
{
/// Height key.
heightDefined = true;
- const std::string heightStr = valueGet.second.Get<std::string>();
-
- height = StringToFloat( heightStr.c_str() );
+ if( valueGet.second.GetType() == Dali::Property::STRING )
+ {
+ const std::string heightStr = valueGet.second.Get<std::string>();
+ height = StringToFloat( heightStr.c_str() );
+ }
+ else
+ {
+ height = valueGet.second.Get<float>();
+ }
}
}
bool& colorDefined,
Vector4& color,
bool& widthDefined,
- float& width )
+ unsigned int& width )
{
const unsigned int numberOfItems = underlinePropertiesMap.Count();
{
/// Width key.
widthDefined = true;
- width = valueGet.second.Get<float>();
+ width = static_cast<unsigned int>( valueGet.second.Get<float>() );
}
}
heightDefined,
height );
- controller->UnderlineSetByString( !empty);
+ controller->UnderlineSetByString( !empty );
}
}
else
bool colorDefined = false;
Vector4 color;
bool widthDefined = false;
- float width = 0.f;
+ unsigned int width = 0u;
bool empty = true;
update = true;
}
- if( widthDefined && ( fabsf( controller->GetOutlineWidth() - width ) > Math::MACHINE_EPSILON_1000 ) )
+ if( widthDefined && ( controller->GetOutlineWidth() != width ) )
{
controller->SetOutlineWidth( width );
update = true;
else
{
// Disable outline
- if( fabsf( controller->GetOutlineWidth() ) > Math::MACHINE_EPSILON_1000 )
+ if( 0u != controller->GetOutlineWidth() )
{
- controller->SetOutlineWidth( 0.0f );
+ controller->SetOutlineWidth( 0u );
update = true;
}
}
else
{
const Vector4& color = controller->GetOutlineColor();
- const float width = controller->GetOutlineWidth();
+ const unsigned int width = controller->GetOutlineWidth();
Property::Map map;
-
- std::string colorStr;
- Vector4ToColorString( color, colorStr );
- map.Insert( COLOR_KEY, colorStr );
-
- std::string widthStr;
- FloatToString( width, widthStr );
- map.Insert( WIDTH_KEY, widthStr );
+ map.Insert( COLOR_KEY, color );
+ map.Insert( WIDTH_KEY, static_cast<int>( width ) );
value = map;