Improve readability.

This commit is contained in:
Jeff Young 2023-04-08 15:06:17 +01:00
parent 3b63d70d01
commit e522e73e0e
1 changed files with 4 additions and 6 deletions

View File

@ -532,13 +532,13 @@ void DP_GATEWAYS::BuildForCursor( const VECTOR2I& aCursorPos )
{
int gap = m_fitVias ? m_viaGap + m_viaDiameter : m_gap;
for( int attempt = 0; attempt < 2; attempt++ )
for( bool diagonal : { false, true } )
{
for( int i = 0; i < 4; i++ )
{
VECTOR2I dir;
if( !attempt )
if( !diagonal )
{
dir = makeGapVector( VECTOR2I( gap, gap ), gap );
@ -559,9 +559,7 @@ void DP_GATEWAYS::BuildForCursor( const VECTOR2I& aCursorPos )
if( m_fitVias )
BuildGeneric( aCursorPos + dir, aCursorPos - dir, true, true );
else
m_gateways.emplace_back( aCursorPos + dir, aCursorPos - dir,
attempt ? true : false );
m_gateways.emplace_back( aCursorPos + dir, aCursorPos - dir, diagonal );
}
}
}