Simplify shape building logic.
Fixes https://gitlab.com/kicad/code/kicad/issues/6244
This commit is contained in:
parent
fbcbed5543
commit
a0060086b0
|
@ -371,25 +371,16 @@ void DIMENSION::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_I
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::vector<SHAPE*> DIMENSION::MakeEffectiveShapes() const
|
|
||||||
{
|
|
||||||
std::vector<SHAPE*> effectiveShapes;
|
|
||||||
|
|
||||||
std::shared_ptr<SHAPE_COMPOUND> ets = Text().GetEffectiveTextShape();
|
|
||||||
|
|
||||||
for( const SHAPE* shape : ets->Shapes() )
|
|
||||||
effectiveShapes.emplace_back( shape->Clone() );
|
|
||||||
|
|
||||||
for( const std::shared_ptr<SHAPE>& shape : GetShapes() )
|
|
||||||
effectiveShapes.emplace_back( shape->Clone() );
|
|
||||||
|
|
||||||
return effectiveShapes;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::shared_ptr<SHAPE> DIMENSION::GetEffectiveShape( PCB_LAYER_ID aLayer ) const
|
std::shared_ptr<SHAPE> DIMENSION::GetEffectiveShape( PCB_LAYER_ID aLayer ) const
|
||||||
{
|
{
|
||||||
return std::make_shared<SHAPE_COMPOUND>( MakeEffectiveShapes() );
|
std::shared_ptr<SHAPE_COMPOUND> effectiveShape = std::make_shared<SHAPE_COMPOUND>();
|
||||||
|
|
||||||
|
effectiveShape->AddShape( Text().GetEffectiveTextShape()->Clone() );
|
||||||
|
|
||||||
|
for( const std::shared_ptr<SHAPE>& shape : GetShapes() )
|
||||||
|
effectiveShape->AddShape( shape->Clone() );
|
||||||
|
|
||||||
|
return effectiveShape;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -224,12 +224,6 @@ public:
|
||||||
*/
|
*/
|
||||||
const std::vector<std::shared_ptr<SHAPE>>& GetShapes() const { return m_shapes; }
|
const std::vector<std::shared_ptr<SHAPE>>& GetShapes() const { return m_shapes; }
|
||||||
|
|
||||||
/**
|
|
||||||
* @return create a caller-owned list of *all* shapes (including any text).
|
|
||||||
* Used for collision calculations (DRC, PNS, etc.).
|
|
||||||
*/
|
|
||||||
std::vector<SHAPE*> MakeEffectiveShapes() const;
|
|
||||||
|
|
||||||
// BOARD_ITEM overrides
|
// BOARD_ITEM overrides
|
||||||
|
|
||||||
void Move( const wxPoint& offset ) override;
|
void Move( const wxPoint& offset ) override;
|
||||||
|
|
Loading…
Reference in New Issue