PNS: Use segment shape for all oval pads
Instead of calculating a simple polygon for the oval pads that are
rotated, we use a rotated segment.
Fixes https://gitlab.com/kicad/code/kicad/issues/4604
(cherry picked from commit 25b8da8e3b
)
This commit is contained in:
parent
ab83c86210
commit
1c46bf1955
|
@ -724,44 +724,12 @@ std::unique_ptr<PNS::SOLID> PNS_KICAD_IFACE_BASE::syncPad( D_PAD* aPad )
|
||||||
{
|
{
|
||||||
wxPoint start;
|
wxPoint start;
|
||||||
wxPoint end;
|
wxPoint end;
|
||||||
wxPoint corner;
|
|
||||||
|
|
||||||
SHAPE_SIMPLE* shape = new SHAPE_SIMPLE();
|
int w = aPad->BuildSegmentFromOvalShape( start, end, aPad->GetOrientation(),
|
||||||
|
wxSize( 0, 0 ) );
|
||||||
int w = aPad->BuildSegmentFromOvalShape( start, end, 0.0, wxSize( 0, 0 ) );
|
|
||||||
|
|
||||||
if( start.y == 0 )
|
|
||||||
corner = wxPoint( start.x, -( w / 2 ) );
|
|
||||||
else
|
|
||||||
corner = wxPoint( w / 2, start.y );
|
|
||||||
|
|
||||||
RotatePoint( &start, aPad->GetOrientation() );
|
|
||||||
RotatePoint( &corner, aPad->GetOrientation() );
|
|
||||||
shape->Append( wx_c + corner );
|
|
||||||
|
|
||||||
for( int rot = 100; rot <= 1800; rot += 100 )
|
|
||||||
{
|
|
||||||
wxPoint p( corner );
|
|
||||||
RotatePoint( &p, start, rot );
|
|
||||||
shape->Append( wx_c + p );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( end.y == 0 )
|
|
||||||
corner = wxPoint( end.x, w / 2 );
|
|
||||||
else
|
|
||||||
corner = wxPoint( -( w / 2 ), end.y );
|
|
||||||
|
|
||||||
RotatePoint( &end, aPad->GetOrientation() );
|
|
||||||
RotatePoint( &corner, aPad->GetOrientation() );
|
|
||||||
shape->Append( wx_c + corner );
|
|
||||||
|
|
||||||
for( int rot = 100; rot <= 1800; rot += 100 )
|
|
||||||
{
|
|
||||||
wxPoint p( corner );
|
|
||||||
RotatePoint( &p, end, rot );
|
|
||||||
shape->Append( wx_c + p );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
SHAPE_SEGMENT* shape = new SHAPE_SEGMENT( start, end, w );
|
||||||
|
shape->Move( aPad->ShapePos() );
|
||||||
solid->SetShape( shape );
|
solid->SetShape( shape );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue