Fix build

This commit is contained in:
Jon Evans 2024-02-08 17:33:34 -05:00
parent ecbe1df7c1
commit 7929d7cda2
1 changed files with 4 additions and 16 deletions

View File

@ -393,7 +393,7 @@ public:
std::optional<int> GetTargetLength() const std::optional<int> GetTargetLength() const
{ {
if( m_unconstrained ) if( m_settings.m_targetLength.Opt() == PNS::MEANDER_SETTINGS::LENGTH_UNCONSTRAINED )
return std::optional<int>(); return std::optional<int>();
else else
return m_settings.m_targetLength.Opt(); return m_settings.m_targetLength.Opt();
@ -402,20 +402,14 @@ public:
void SetTargetLength( std::optional<int> aValue ) void SetTargetLength( std::optional<int> aValue )
{ {
if( aValue.has_value() ) if( aValue.has_value() )
{
m_unconstrained = false;
m_settings.SetTargetLength( aValue.value() ); m_settings.SetTargetLength( aValue.value() );
}
else else
{ m_settings.SetTargetLength( PNS::MEANDER_SETTINGS::LENGTH_UNCONSTRAINED );
m_unconstrained = true;
m_settings.SetTargetLength( std::numeric_limits<long long int>::max() );
}
} }
std::optional<int> GetTargetSkew() const std::optional<int> GetTargetSkew() const
{ {
if( m_unconstrained ) if( m_settings.m_targetLength.Opt() == PNS::MEANDER_SETTINGS::LENGTH_UNCONSTRAINED )
return std::optional<int>(); return std::optional<int>();
else else
return m_settings.m_targetSkew.Opt(); return m_settings.m_targetSkew.Opt();
@ -424,15 +418,9 @@ public:
void SetTargetSkew( std::optional<int> aValue ) void SetTargetSkew( std::optional<int> aValue )
{ {
if( aValue.has_value() ) if( aValue.has_value() )
{
m_unconstrained = false;
m_settings.SetTargetSkew( aValue.value() ); m_settings.SetTargetSkew( aValue.value() );
}
else else
{ m_settings.SetTargetSkew( PNS::MEANDER_SETTINGS::LENGTH_UNCONSTRAINED );
m_unconstrained = true;
m_settings.SetTargetSkew( std::numeric_limits<int>::max() );
}
} }
bool GetOverrideCustomRules() const { return m_settings.m_overrideCustomRules; } bool GetOverrideCustomRules() const { return m_settings.m_overrideCustomRules; }