Remove ToLayer_ID calls from color checks
Colors are assigned to virtual layers while the ToLayer_ID returns a physical layer enum. The GetLayerColor/SetLayerColor take LAYER_NUM (int) values that can be larger than the physical layer count.
This commit is contained in:
parent
d90d4ff682
commit
3ce8a4856a
|
@ -150,7 +150,7 @@ COLOR4D PCB_LAYER_BOX_SELECTOR::GetLayerColor( LAYER_NUM aLayer ) const
|
|||
{
|
||||
wxASSERT( m_boardFrame );
|
||||
|
||||
return m_boardFrame->Settings().Colors().GetLayerColor( ToLAYER_ID( aLayer ) );
|
||||
return m_boardFrame->Settings().Colors().GetLayerColor( aLayer );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -584,11 +584,11 @@ void PCB_LAYER_WIDGET::OnLayerColorChange( int aLayer, COLOR4D aColor )
|
|||
// destroys the GAL color setup
|
||||
if( !myframe->IsGalCanvasActive() )
|
||||
{
|
||||
COLOR4D oldColor = myframe->Settings().Colors().GetLayerColor( ToLAYER_ID( aLayer ) );
|
||||
COLOR4D oldColor = myframe->Settings().Colors().GetLayerColor( aLayer );
|
||||
aColor.a = oldColor.a;
|
||||
}
|
||||
|
||||
myframe->Settings().Colors().SetLayerColor( ToLAYER_ID( aLayer ), aColor );
|
||||
myframe->Settings().Colors().SetLayerColor( aLayer, aColor );
|
||||
|
||||
if( myframe->IsGalCanvasActive() )
|
||||
{
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
|
||||
COLOR4D BRDITEMS_PLOTTER::getColor( LAYER_NUM aLayer )
|
||||
{
|
||||
COLOR4D color = m_board->Colors().GetLayerColor( ToLAYER_ID( aLayer ) );
|
||||
COLOR4D color = m_board->Colors().GetLayerColor( aLayer );
|
||||
|
||||
// A hack to avoid plotting ahite itmen in white color, expecting the paper
|
||||
// is also white: use a non white color:
|
||||
|
|
|
@ -61,7 +61,7 @@ protected:
|
|||
// Virtual function
|
||||
COLOR4D GetLayerColor( LAYER_NUM aLayer ) const override
|
||||
{
|
||||
return m_frame->Settings().Colors().GetLayerColor( ToLAYER_ID( aLayer ) );
|
||||
return m_frame->Settings().Colors().GetLayerColor( aLayer );
|
||||
}
|
||||
|
||||
// Returns the name of the layer id
|
||||
|
|
Loading…
Reference in New Issue