diff --git a/common/page_layout/ws_proxy_view_item.cpp b/common/page_layout/ws_proxy_view_item.cpp index 7a63f9231d..934c74d16e 100644 --- a/common/page_layout/ws_proxy_view_item.cpp +++ b/common/page_layout/ws_proxy_view_item.cpp @@ -41,7 +41,8 @@ WS_PROXY_VIEW_ITEM::WS_PROXY_VIEW_ITEM( int aMils2IUscalefactor, const PAGE_INFO m_sheetNumber( 1 ), m_sheetCount( 1 ), 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->SetSelectedColor( settings->GetLayerColor( LAYER_SELECT_OVERLAY ) ); 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 for( WS_DRAW_ITEM_BASE* item = drawList.GetFirst(); item; item = drawList.GetNext() ) diff --git a/eeschema/sch_view.cpp b/eeschema/sch_view.cpp index 4ee37a419f..ff3bd8f830 100644 --- a/eeschema/sch_view.cpp +++ b/eeschema/sch_view.cpp @@ -96,6 +96,7 @@ void SCH_VIEW::DisplaySheet( SCH_SCREEN *aScreen ) m_worksheet->SetSheetCount( aScreen->m_NumberOfScreens ); m_worksheet->SetFileName( TO_UTF8( aScreen->GetFileName() ) ); m_worksheet->SetColorLayer( LAYER_SCHEMATIC_WORKSHEET ); + m_worksheet->SetPageBorderColorLayer( LAYER_SCHEMATIC_GRID ); if( m_frame && m_frame->IsType( FRAME_SCH ) ) m_worksheet->SetSheetName( TO_UTF8( m_frame->GetScreenDesc() ) ); diff --git a/include/ws_proxy_view_item.h b/include/ws_proxy_view_item.h index 582a3e72da..d7e1acce50 100644 --- a/include/ws_proxy_view_item.h +++ b/include/ws_proxy_view_item.h @@ -80,6 +80,15 @@ public: 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 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) int m_colorLayer; + + /// Layer that is used for page border color + int m_pageBorderColorLayer; }; }