Make sure pad primitives get normalized before diff'ing.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15208
This commit is contained in:
Jeff Young 2023-08-03 18:00:22 +01:00
parent 297bbca0ea
commit a9b7b73f10
1 changed files with 13 additions and 1 deletions

View File

@ -135,8 +135,20 @@ bool primitiveNeedsUpdate( const std::shared_ptr<PCB_SHAPE>& a,
switch( a->GetShape() )
{
case SHAPE_T::SEGMENT:
case SHAPE_T::RECTANGLE:
{
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(), "" );