pcbnew: diff pair filter bugfix

Added required action on the std::remove_if construct to erase elements
matching the filter
This commit is contained in:
Seth Hillbrand 2018-06-24 13:22:21 -07:00
parent 4af699e919
commit b3db6572e8
1 changed files with 6 additions and 4 deletions

View File

@ -400,10 +400,12 @@ bool DP_GATEWAYS::checkDiagonalAlignment( const VECTOR2I& a, const VECTOR2I& b )
void DP_GATEWAYS::FilterByOrientation ( int aAngleMask, DIRECTION_45 aRefOrientation ) void DP_GATEWAYS::FilterByOrientation ( int aAngleMask, DIRECTION_45 aRefOrientation )
{ {
m_gateways.erase(
std::remove_if( m_gateways.begin(), m_gateways.end(), [aAngleMask, aRefOrientation]( const DP_GATEWAY& dp) { std::remove_if( m_gateways.begin(), m_gateways.end(), [aAngleMask, aRefOrientation]( const DP_GATEWAY& dp) {
DIRECTION_45 orient( dp.AnchorP() - dp.AnchorN() ); DIRECTION_45 orient( dp.AnchorP() - dp.AnchorN() );
return !( orient.Angle( aRefOrientation ) & aAngleMask ); return !( orient.Angle( aRefOrientation ) & aAngleMask );
} ); } ), m_gateways.end()
);
} }
static VECTOR2I makeGapVector( VECTOR2I dir, int length ) static VECTOR2I makeGapVector( VECTOR2I dir, int length )