mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
GENCAD export: Fixes to footprint hashing
(cherry picked from commit 380b5160d6a5b722a07c8c27cfe0ba3006780253)
This commit is contained in:
parent
4ba7cff25e
commit
d7eea3cf7b
@ -264,6 +264,16 @@ size_t hash_fp_item( const EDA_ITEM* aItem, int aFlags )
|
||||
point -= shape->GetPosition();
|
||||
}
|
||||
|
||||
//Basic sort of start/end points to try to always draw the same direction (left to right, down to up)
|
||||
//The hashes are summed, so it doesn't matter what order the lines are drawn, only that the same points are used
|
||||
if( points.size() > 1 )
|
||||
{
|
||||
if( points[0].x > points[1].x || points[0].y > points[1].y )
|
||||
{
|
||||
std::swap( points[0], points[1] );
|
||||
}
|
||||
}
|
||||
|
||||
for( VECTOR2I& point : points )
|
||||
hash_combine( ret, point.x, point.y );
|
||||
}
|
||||
|
@ -612,9 +612,6 @@ static size_t hashFootprint( const FOOTPRINT* aFootprint )
|
||||
constexpr int flags = HASH_FLAGS::HASH_POS | HASH_FLAGS::REL_COORD
|
||||
| HASH_FLAGS::HASH_ROT | HASH_FLAGS::HASH_LAYER;
|
||||
|
||||
for( PCB_FIELD* i : aFootprint->GetFields() )
|
||||
ret += hash_fp_item( i, flags );
|
||||
|
||||
for( BOARD_ITEM* i : aFootprint->GraphicalItems() )
|
||||
ret += hash_fp_item( i, flags );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user