router: Fix clamp in meander corner radius calculation.

Fixes https://gitlab.com/kicad/code/kicad/issues/13781
This commit is contained in:
Alex 2023-02-05 07:22:35 +03:00
parent 74a242c662
commit bf1a8f2582
1 changed files with 4 additions and 3 deletions

View File

@ -211,9 +211,10 @@ int MEANDER_SHAPE::cornerRadius() const
int minCr = std::abs( m_baselineOffset );
int maxCr = std::min( m_amplitude / 2, spacing() / 2 );
int cr = std::clamp( optCr, minCr, maxCr );
return cr;
if( maxCr > minCr )
return std::clamp( optCr, minCr, maxCr );
else
return maxCr;
}