FABMASTER: Handle rotated/flipped custom pads
The rotate mirror actions need to line up with the expectation. FABMASTER keeps elements board-referenced while KiCad has some elements referenced to the board and some referenced to the footprint
This commit is contained in:
parent
ff1300d13b
commit
103dde67f6
|
@ -2200,12 +2200,28 @@ bool FABMASTER::loadFootprints( BOARD* aBoard )
|
||||||
poly_outline.Move( -newpad->GetPosition() );
|
poly_outline.Move( -newpad->GetPosition() );
|
||||||
|
|
||||||
if( src->mirror )
|
if( src->mirror )
|
||||||
|
{
|
||||||
|
poly_outline.Mirror( false, true, VECTOR2I( 0, ( pin->pin_y - src->y ) ) );
|
||||||
poly_outline.Rotate( ( -src->rotate + pin->rotation ) * M_PI / 180.0 );
|
poly_outline.Rotate( ( -src->rotate + pin->rotation ) * M_PI / 180.0 );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
poly_outline.Rotate( ( src->rotate - pin->rotation ) * M_PI / 180.0 );
|
poly_outline.Rotate( ( src->rotate - pin->rotation ) * M_PI / 180.0 );
|
||||||
|
}
|
||||||
|
|
||||||
newpad->AddPrimitivePoly( poly_outline, 0, true );
|
newpad->AddPrimitivePoly( poly_outline, 0, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SHAPE_POLY_SET mergedPolygon;
|
||||||
|
newpad->MergePrimitivesAsPolygon( &mergedPolygon, UNDEFINED_LAYER );
|
||||||
|
|
||||||
|
if( mergedPolygon.OutlineCount() > 1 )
|
||||||
|
{
|
||||||
|
wxLogError( wxString::Format(
|
||||||
|
_( "Invalid custom pad named '%s'. Replacing with circular pad." ),
|
||||||
|
custom_name.c_str() ) );
|
||||||
|
newpad->SetShape( PAD_SHAPE_CIRCLE );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue