Fill in missing bits of LAYER variable for printing/plotting.
Fixes https://gitlab.com/kicad/code/kicad/issues/11788
This commit is contained in:
parent
20f4e62176
commit
f22cf1cc3a
|
@ -133,6 +133,8 @@ void BOARD_PRINTOUT::DrawPage( const wxString& aLayerName, int aPageNum, int aPa
|
|||
setupPainter( *painter );
|
||||
setupViewLayers( *view, m_settings.m_LayerSet );
|
||||
|
||||
dstSettings->SetLayerName( aLayerName );
|
||||
|
||||
VECTOR2I sheetSizeMils = m_settings.m_pageInfo.GetSizeMils();
|
||||
VECTOR2I sheetSizeIU( milsToIU( sheetSizeMils.x ),
|
||||
milsToIU( sheetSizeMils.y ) );
|
||||
|
|
|
@ -86,6 +86,7 @@ void DS_PROXY_VIEW_ITEM::buildDrawList( VIEW* aView, DS_DRAW_ITEM_LIST* aDrawLis
|
|||
aDrawList->SetFileName( fileName );
|
||||
aDrawList->SetSheetName( sheetName );
|
||||
aDrawList->SetSheetPath( sheetPath );
|
||||
aDrawList->SetSheetLayer( settings->GetLayerName() );
|
||||
aDrawList->SetProject( m_project );
|
||||
|
||||
aDrawList->BuildDrawItemsList( *m_pageInfo, *m_titleBlock );
|
||||
|
|
|
@ -86,6 +86,7 @@ void PlotDrawingSheet( PLOTTER* plotter, const PROJECT* aProject, const TITLE_BL
|
|||
drawList.SetFileName( fn.GetFullName() ); // Print only the short filename
|
||||
drawList.SetSheetName( aSheetName );
|
||||
drawList.SetSheetPath( aSheetPath );
|
||||
drawList.SetSheetLayer( plotter->RenderSettings()->GetLayerName() );
|
||||
drawList.SetProject( aProject );
|
||||
drawList.SetIsFirstPage( aIsFirstPage );
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019-2020 KiCad Developers, see AUTHORS.TXT for contributors.
|
||||
* Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.TXT for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -112,6 +112,9 @@ public:
|
|||
PCB_LAYER_ID GetActiveLayer() const { return m_activeLayer; }
|
||||
void SetActiveLayer( PCB_LAYER_ID aLayer ) { m_activeLayer = aLayer; }
|
||||
|
||||
const wxString& GetLayerName() const { return m_layerName; }
|
||||
void SetLayerName( const wxString& aLayerName ) { m_layerName = aLayerName; }
|
||||
|
||||
/**
|
||||
* Clear the list of active layers.
|
||||
*/
|
||||
|
@ -293,6 +296,7 @@ protected:
|
|||
virtual void update();
|
||||
|
||||
PCB_LAYER_ID m_activeLayer; // The active layer (as shown by appearance mgr)
|
||||
wxString m_layerName;
|
||||
std::set<unsigned int> m_highContrastLayers; // High-contrast layers (both board layers and
|
||||
// synthetic GAL layers)
|
||||
COLOR4D m_layerColors[LAYER_ID_COUNT]; // Layer colors
|
||||
|
|
|
@ -109,7 +109,7 @@ bool PCBNEW_PRINTOUT::OnPrintPage( int aPage )
|
|||
if( extractLayer == UNDEFINED_LAYER )
|
||||
layerName = _( "Multiple Layers" );
|
||||
else
|
||||
layerName = LSET::Name( extractLayer );
|
||||
layerName = m_board->GetLayerName( extractLayer );
|
||||
|
||||
// In Pcbnew we can want the layer EDGE always printed
|
||||
if( m_pcbnewSettings.m_PrintEdgeCutsOnAllPages )
|
||||
|
|
|
@ -1141,6 +1141,10 @@ PLOTTER* StartPlotBoard( BOARD *aBoard, const PCB_PLOT_PARAMS *aPlotOpts, int aL
|
|||
KIGFX::PCB_RENDER_SETTINGS* renderSettings = new KIGFX::PCB_RENDER_SETTINGS();
|
||||
renderSettings->LoadColors( aPlotOpts->ColorSettings() );
|
||||
renderSettings->SetDefaultPenWidth( Millimeter2iu( 0.0212 ) ); // Hairline at 1200dpi
|
||||
|
||||
if( aLayer < GAL_LAYER_ID_END )
|
||||
renderSettings->SetLayerName( aBoard->GetLayerName( ToLAYER_ID( aLayer ) ) );
|
||||
|
||||
plotter->SetRenderSettings( renderSettings );
|
||||
|
||||
// Compute the viewport and set the other options
|
||||
|
|
Loading…
Reference in New Issue