Make sure opposite-corner rects test the same.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14907
This commit is contained in:
Jeff Young 2023-06-10 22:29:55 +01:00
parent 96a221ceba
commit fcb156c323
1 changed files with 13 additions and 1 deletions

View File

@ -274,8 +274,20 @@ bool shapeNeedsUpdate( const PCB_SHAPE* a, const PCB_SHAPE* b )
switch( a->GetShape() )
{
case SHAPE_T::SEGMENT:
case SHAPE_T::RECT:
{
BOX2I aRect( a->GetStart(), a->GetEnd() - a->GetStart() );
BOX2I bRect( b->GetStart(), b->GetEnd() - b->GetStart() );
aRect.Normalize();
bRect.Normalize();
TEST( aRect.GetOrigin(), bRect.GetOrigin(), "" );
TEST( aRect.GetEnd(), bRect.GetEnd(), "" );
break;
}
case SHAPE_T::SEGMENT:
case SHAPE_T::CIRCLE:
TEST( a->GetStart(), b->GetStart(), "" );
TEST( a->GetEnd(), b->GetEnd(), "" );