FOOTPRINT::cmp_drawings(): fix a incorrect sort criteria for polygons:

for polygons, GetStart() and GetEnd() have no meaning and cannotbe used
for sorting.
This commit is contained in:
jean-pierre charras 2023-11-13 18:36:00 +01:00
parent 752d2d5295
commit f6314e6401
1 changed files with 7 additions and 2 deletions

View File

@ -3015,8 +3015,13 @@ bool FOOTPRINT::cmp_drawings::operator()( const BOARD_ITEM* itemA, const BOARD_I
TEST( dwgA->GetShape(), dwgB->GetShape() );
TEST_PT( dwgA->GetStart(), dwgB->GetStart() );
TEST_PT( dwgA->GetEnd(), dwgB->GetEnd() );
// GetStart() and GetEnd() have no meaning with polygons.
// We cannot use them for sorting polygons
if( dwgA->GetShape() != SHAPE_T::POLY )
{
TEST_PT( dwgA->GetStart(), dwgB->GetStart() );
TEST_PT( dwgA->GetEnd(), dwgB->GetEnd() );
}
if( dwgA->GetShape() == SHAPE_T::ARC )
{