Formatting.

This commit is contained in:
Jeff Young 2021-03-16 11:42:59 +00:00
parent 2ad9da582a
commit c7648b4dba
1 changed files with 10 additions and 14 deletions

View File

@ -84,33 +84,29 @@ void PCB_EDIT_FRAME::SwitchLayer( wxDC* DC, PCB_LAYER_ID layer )
if( layer == curLayer )
return;
// Copper layers cannot be selected unconditionally; how many
// of those layers are currently enabled needs to be checked.
// Copper layers cannot be selected unconditionally; how many of those layers are currently
// enabled needs to be checked.
if( IsCopperLayer( layer ) )
{
// If only one copper layer is enabled, the only such layer
// that can be selected to is the "Back" layer (so the
// selection of any other copper layer is disregarded).
// If only one copper layer is enabled, the only such layer that can be selected to is
// the "Back" layer (so the selection of any other copper layer is disregarded).
if( GetBoard()->GetCopperLayerCount() < 2 )
{
if( layer != B_Cu )
return;
}
// If more than one copper layer is enabled, the "Copper"
// and "Component" layers can be selected, but the total
// number of copper layers determines which internal
// layers are also capable of being selected.
// If more than one copper layer is enabled, the "Copper" and "Component" layers can be
// selected, but the total number of copper layers determines which internal layers are
// also capable of being selected.
else
{
if( layer != B_Cu && layer != F_Cu && layer >= GetBoard()->GetCopperLayerCount() - 1 )
if( layer != B_Cu && layer != F_Cu && layer >= GetBoard()->GetCopperLayerCount() - 1 )
return;
}
}
// Is yet more checking required? E.g. when the layer to be selected
// is a non-copper layer, or when switching between a copper layer
// and a non-copper layer, or vice-versa?
// ...
// Is yet more checking required? E.g. when the layer to be selected is a non-copper layer,
// or when switching between a copper layer and a non-copper layer, or vice-versa?
SetActiveLayer( layer );