Calculate and show pad area in footprint editor

When selecting an SMD pad, show the area of the pad in the msg panel

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17788
This commit is contained in:
Seth Hillbrand 2024-04-17 15:31:14 -07:00
parent 2f7cc5fa2b
commit f088b0d18a
1 changed files with 11 additions and 0 deletions

View File

@ -1196,6 +1196,17 @@ void PAD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>&
if( GetAttribute() == PAD_ATTRIB::SMD || GetAttribute() == PAD_ATTRIB::CONN )
aList.emplace_back( _( "Layer" ), layerMaskDescribe() );
if( aFrame->GetName() == FOOTPRINT_EDIT_FRAME_NAME )
{
if( GetAttribute() == PAD_ATTRIB::SMD )
{
const std::shared_ptr<SHAPE_POLY_SET>& poly = PAD::GetEffectivePolygon();
double area = poly->Area();
aList.emplace_back( _( "Area" ), aFrame->MessageTextFromValue( area, true, EDA_DATA_TYPE::AREA ) );
}
}
// Show the pad shape, attribute and property
wxString props = ShowPadAttr();