Fix bug: matchItemsBySimilarity(): ensure pad numbers are taken in account

This bug was responsible of clearing pad nets when updated footprints from lib.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22625
This commit is contained in:
jean-pierre charras
2026-01-09 07:51:54 +01:00
parent d29f5c189e
commit 78ec6bf876
+5 -7
View File
@@ -2392,18 +2392,16 @@ static std::vector<std::pair<T*, T*>> matchItemsBySimilarity( const std::vector<
double similarity = existing->Similarity( *updated );
if( similarity <= 0.0 )
continue;
double score = similarity;
if constexpr( std::is_same_v<T, PAD> )
{
if( existing->GetNumber() == updated->GetNumber() )
score += 2.0;
similarity += 2.0;
}
candidates.push_back( { existing, updated, score } );
if( similarity <= 0.0 )
continue;
candidates.push_back( { existing, updated, similarity } );
}
}