Fix missing changes from last commit

This commit is contained in:
Jon Evans 2020-03-07 16:10:37 -05:00
parent 8cb8d55843
commit 0df2191663
2 changed files with 12 additions and 14 deletions

View File

@ -89,12 +89,8 @@ public:
COLOR4D val = m_default;
try
{
val = aSettings->Get<COLOR4D>( m_path );
}
catch( ... )
{}
if( OPT<COLOR4D> optval = aSettings->Get<COLOR4D>( m_path ) )
val = *optval;
*m_ptr = val;
}

View File

@ -141,9 +141,15 @@ public:
ValueType val = m_default;
if( std::is_same<ValueType, nlohmann::json>::value )
val = aSettings->GetJson( m_path );
{
if( OPT<nlohmann::json> optval = aSettings->GetJson( m_path ) )
val = *optval;
}
else
val = aSettings->Get<ValueType>( m_path );
{
if( OPT<ValueType> optval = aSettings->Get<ValueType>( m_path ) )
val = *optval;
}
m_setter( val );
}
@ -206,12 +212,8 @@ public:
double dval = m_default * m_scale;
try
{
dval = aSettings->Get<double>( m_path );
}
catch( ... )
{}
if( OPT<double> optval = aSettings->Get<double>( m_path ) )
dval = *optval;
ValueType val = KiROUND<ValueType>( dval / m_scale );