Browse Source

Fix missing changes from last commit

pull/16/head
Jon Evans 6 years ago
parent
commit
0df2191663
  1. 8
      3d-viewer/3d_viewer/3d_viewer_settings.h
  2. 18
      include/settings/parameters.h

8
3d-viewer/3d_viewer/3d_viewer_settings.h

@ -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;
}

18
include/settings/parameters.h

@ -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 );

Loading…
Cancel
Save