Remove dead code and simplify remaining logic.

This commit is contained in:
Jeff Young 2020-01-11 16:21:43 +00:00
parent 43abd53b19
commit 9182b3a850
1 changed files with 4 additions and 27 deletions

View File

@ -34,7 +34,6 @@ int PCB_EDIT_FRAME::SetTrackSegmentWidth( TRACK* aTrackItem,
PICKED_ITEMS_LIST* aItemsListPicker, PICKED_ITEMS_LIST* aItemsListPicker,
bool aUseNetclassValue ) bool aUseNetclassValue )
{ {
int return_code = TRACK_ACTION_NONE;
int initial_width; int initial_width;
int new_width; int new_width;
int initial_drill = -1; int initial_drill = -1;
@ -98,29 +97,7 @@ int PCB_EDIT_FRAME::SetTrackSegmentWidth( TRACK* aTrackItem,
} }
} }
aTrackItem->SetWidth( new_width ); if( initial_width != new_width || initial_drill != new_drill )
// make a DRC test because the new size is bigger than the old size
if( initial_width < new_width )
{
int diagdrc = OK_DRC;
return_code = TRACK_ACTION_SUCCESS;
if( diagdrc != OK_DRC )
return_code = TRACK_ACTION_DRC_ERROR;
}
else if( initial_width > new_width )
{
return_code = TRACK_ACTION_SUCCESS;
}
else if( (aTrackItem->Type() == PCB_VIA_T) )
{
// if a via has its drill value changed, force change
if( initial_drill != new_drill )
return_code = TRACK_ACTION_SUCCESS;
}
if( return_code == TRACK_ACTION_SUCCESS )
{ {
OnModify(); OnModify();
@ -142,13 +119,13 @@ int PCB_EDIT_FRAME::SetTrackSegmentWidth( TRACK* aTrackItem,
via->SetDrillDefault(); via->SetDrillDefault();
} }
} }
return TRACK_ACTION_SUCCESS;
} }
else else
{ {
aTrackItem->SetWidth( initial_width ); return TRACK_ACTION_NONE;
} }
return return_code;
} }