mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-07 18:45:32 +00:00
Formatting.
This commit is contained in:
parent
937f225df0
commit
d16a5bf87d
@ -2017,34 +2017,36 @@ int PCB_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent )
|
||||
// Lambda to accumulate track length if item is a track or arc, otherwise mark invalid
|
||||
std::function<void( EDA_ITEM* )> accumulateTrackLength;
|
||||
|
||||
accumulateTrackLength = [&]( EDA_ITEM* aItem )
|
||||
{
|
||||
if( PCB_TRACK* track = dynamic_cast<PCB_TRACK*>( aItem ) )
|
||||
{
|
||||
selectedLength += track->GetLength();
|
||||
}
|
||||
else if( PCB_SHAPE* shape = dynamic_cast<PCB_SHAPE*>( aItem ) )
|
||||
{
|
||||
const SHAPE_T shapeType = shape->GetShape();
|
||||
if( shapeType == SHAPE_T::SEGMENT || shapeType == SHAPE_T::ARC
|
||||
|| shapeType == SHAPE_T::BEZIER )
|
||||
accumulateTrackLength =
|
||||
[&]( EDA_ITEM* aItem )
|
||||
{
|
||||
selectedLength += shape->GetLength();
|
||||
}
|
||||
else
|
||||
{
|
||||
lengthValid = false;
|
||||
}
|
||||
}
|
||||
else if( PCB_GROUP* group = dynamic_cast<PCB_GROUP*>( aItem ) )
|
||||
{
|
||||
group->RunOnChildren( accumulateTrackLength );
|
||||
}
|
||||
else
|
||||
{
|
||||
lengthValid = false;
|
||||
}
|
||||
};
|
||||
if( PCB_TRACK* track = dynamic_cast<PCB_TRACK*>( aItem ) )
|
||||
{
|
||||
selectedLength += track->GetLength();
|
||||
}
|
||||
else if( PCB_SHAPE* shape = dynamic_cast<PCB_SHAPE*>( aItem ) )
|
||||
{
|
||||
const SHAPE_T shapeType = shape->GetShape();
|
||||
|
||||
if( shapeType == SHAPE_T::SEGMENT || shapeType == SHAPE_T::ARC
|
||||
|| shapeType == SHAPE_T::BEZIER )
|
||||
{
|
||||
selectedLength += shape->GetLength();
|
||||
}
|
||||
else
|
||||
{
|
||||
lengthValid = false;
|
||||
}
|
||||
}
|
||||
else if( PCB_GROUP* group = dynamic_cast<PCB_GROUP*>( aItem ) )
|
||||
{
|
||||
group->RunOnChildren( accumulateTrackLength );
|
||||
}
|
||||
else
|
||||
{
|
||||
lengthValid = false;
|
||||
}
|
||||
};
|
||||
|
||||
for( EDA_ITEM* item : selection )
|
||||
accumulateTrackLength( item );
|
||||
|
Loading…
Reference in New Issue
Block a user