Move footprint shape offset/rotation stuff to the right place.

Most shapes are already offset/rotated (with thier non-offset/rotated
points in start0, etc.).
This commit is contained in:
Jeff Young 2020-11-15 21:04:12 +00:00
parent b21e07d759
commit 114621eb2c
3 changed files with 7 additions and 20 deletions

View File

@ -106,21 +106,6 @@ void FP_SHAPE::SetDrawCoord()
}
std::shared_ptr<SHAPE> FP_SHAPE::GetEffectiveShape( PCB_LAYER_ID aLayer ) const
{
FOOTPRINT* fp = static_cast<FOOTPRINT*>( m_parent );
std::vector<SHAPE*> shapes = MakeEffectiveShapes();
for( SHAPE* shape : shapes )
{
shape->Rotate( -fp->GetOrientationRadians() );
shape->Move( fp->GetPosition() );
}
return std::make_shared<SHAPE_COMPOUND>( shapes );
}
// see class_edge_mod.h
void FP_SHAPE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
{

View File

@ -130,11 +130,6 @@ public:
*/
void SetDrawCoord();
/**
* Makes a set of SHAPE objects representing the FP_SHAPE. Caller owns the objects.
*/
std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER ) const override;
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
wxString GetClass() const override

View File

@ -1137,6 +1137,13 @@ std::vector<SHAPE*> PCB_SHAPE::MakeEffectiveShapes() const
case S_POLYGON:
{
SHAPE_LINE_CHAIN l = GetPolyShape().COutline( 0 );
FOOTPRINT* parentFootprint = dynamic_cast<FOOTPRINT*>( m_parent );
if( parentFootprint )
{
l.Rotate( -parentFootprint->GetOrientationRadians() );
l.Move( parentFootprint->GetPosition() );
}
if( IsFilled() )
{