Don't use the schematic grid for page border in pcbnew

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5105
This commit is contained in:
Jon Evans 2020-08-07 17:12:10 -04:00
parent e5b50d90a7
commit 413c2cc2c6
3 changed files with 16 additions and 2 deletions

View File

@ -41,7 +41,8 @@ WS_PROXY_VIEW_ITEM::WS_PROXY_VIEW_ITEM( int aMils2IUscalefactor, const PAGE_INFO
m_sheetNumber( 1 ), m_sheetNumber( 1 ),
m_sheetCount( 1 ), m_sheetCount( 1 ),
m_project( aProject ), m_project( aProject ),
m_colorLayer( LAYER_WORKSHEET ) m_colorLayer( LAYER_WORKSHEET ),
m_pageBorderColorLayer( LAYER_GRID )
{ {
} }
@ -110,7 +111,7 @@ void WS_PROXY_VIEW_ITEM::ViewDraw( int aLayer, VIEW* aView ) const
ws_settings->SetNormalColor( settings->GetLayerColor( m_colorLayer ) ); ws_settings->SetNormalColor( settings->GetLayerColor( m_colorLayer ) );
ws_settings->SetSelectedColor( settings->GetLayerColor( LAYER_SELECT_OVERLAY ) ); ws_settings->SetSelectedColor( settings->GetLayerColor( LAYER_SELECT_OVERLAY ) );
ws_settings->SetBrightenedColor( settings->GetLayerColor( LAYER_BRIGHTENED ) ); ws_settings->SetBrightenedColor( settings->GetLayerColor( LAYER_BRIGHTENED ) );
ws_settings->SetPageBorderColor( settings->GetLayerColor( LAYER_SCHEMATIC_GRID ) ); ws_settings->SetPageBorderColor( settings->GetLayerColor( m_pageBorderColorLayer ) );
// Draw all the components that make the page layout // Draw all the components that make the page layout
for( WS_DRAW_ITEM_BASE* item = drawList.GetFirst(); item; item = drawList.GetNext() ) for( WS_DRAW_ITEM_BASE* item = drawList.GetFirst(); item; item = drawList.GetNext() )

View File

@ -96,6 +96,7 @@ void SCH_VIEW::DisplaySheet( SCH_SCREEN *aScreen )
m_worksheet->SetSheetCount( aScreen->m_NumberOfScreens ); m_worksheet->SetSheetCount( aScreen->m_NumberOfScreens );
m_worksheet->SetFileName( TO_UTF8( aScreen->GetFileName() ) ); m_worksheet->SetFileName( TO_UTF8( aScreen->GetFileName() ) );
m_worksheet->SetColorLayer( LAYER_SCHEMATIC_WORKSHEET ); m_worksheet->SetColorLayer( LAYER_SCHEMATIC_WORKSHEET );
m_worksheet->SetPageBorderColorLayer( LAYER_SCHEMATIC_GRID );
if( m_frame && m_frame->IsType( FRAME_SCH ) ) if( m_frame && m_frame->IsType( FRAME_SCH ) )
m_worksheet->SetSheetName( TO_UTF8( m_frame->GetScreenDesc() ) ); m_worksheet->SetSheetName( TO_UTF8( m_frame->GetScreenDesc() ) );

View File

@ -80,6 +80,15 @@ public:
m_colorLayer = aLayerId; m_colorLayer = aLayerId;
} }
/**
* Overrides the layer used to pick the color of the page border (normally LAYER_GRID)
* @param aLayerId is the layer to use
*/
void SetPageBorderColorLayer( int aLayerId )
{
m_pageBorderColorLayer = aLayerId;
}
const PAGE_INFO& GetPageInfo() { return *m_pageInfo; } const PAGE_INFO& GetPageInfo() { return *m_pageInfo; }
const TITLE_BLOCK& GetTitleBlock() { return *m_titleBlock; } const TITLE_BLOCK& GetTitleBlock() { return *m_titleBlock; }
@ -124,6 +133,9 @@ protected:
/// Layer that is used for worksheet color (LAYER_WORKSHEET is always used for visibility) /// Layer that is used for worksheet color (LAYER_WORKSHEET is always used for visibility)
int m_colorLayer; int m_colorLayer;
/// Layer that is used for page border color
int m_pageBorderColorLayer;
}; };
} }