Print solder and paste masks if user asks for them.

Fixes: lp:1613057
* https://bugs.launchpad.net/kicad/+bug/1613057
This commit is contained in:
Jeff Young 2018-02-17 18:05:16 +00:00 committed by Maciej Suminski
parent f7d0c3997d
commit 60a9befe7c
2 changed files with 21 additions and 34 deletions

View File

@ -267,6 +267,22 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDraw_mode,
else else
color = DARKDARKGRAY; color = DARKDARKGRAY;
} }
// If use asks for masks to be printed, then print them.
else if( screen->m_IsPrinting )
{
if( ( IsOnLayer( B_Paste ) && brd->IsLayerVisible( B_Paste ) ) ||
( IsOnLayer( F_Paste ) && brd->IsLayerVisible( F_Paste ) ) )
{
mask_margin = GetSolderPasteMargin();
}
if( ( IsOnLayer( B_Mask ) && brd->IsLayerVisible( B_Mask ) ) ||
( IsOnLayer( F_Mask ) && brd->IsLayerVisible( F_Mask ) ) )
{
mask_margin.x = std::max( mask_margin.x, GetSolderMaskMargin() );
mask_margin.y = std::max( mask_margin.y, GetSolderMaskMargin() );
}
}
if( ( aDraw_mode & GR_HIGHLIGHT ) && !( aDraw_mode & GR_AND ) ) if( ( aDraw_mode & GR_HIGHLIGHT ) && !( aDraw_mode & GR_AND ) )
color.SetToLegacyHighlightColor(); color.SetToLegacyHighlightColor();

View File

@ -139,7 +139,7 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
// Set all board layers as visible, because the print dialog has itself // Set all board layers as visible, because the print dialog has itself
// a layer selection, that have priority over the layer manager setup // a layer selection, that have priority over the layer manager setup
LSET save_visible_brd_layers = Pcb->GetVisibleLayers(); LSET save_visible_brd_layers = Pcb->GetVisibleLayers();
Pcb->SetVisibleLayers( LSET::AllLayersMask() ); Pcb->SetVisibleLayers( aPrintMask );
int save_visible_brd_elements = Pcb->GetVisibleElements(); int save_visible_brd_elements = Pcb->GetVisibleElements();
Pcb->SetElementVisibility( LAYER_PAD_FR, true ); Pcb->SetElementVisibility( LAYER_PAD_FR, true );
@ -147,40 +147,11 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
Pcb->SetElementVisibility( LAYER_MOD_TEXT_FR, true ); Pcb->SetElementVisibility( LAYER_MOD_TEXT_FR, true );
Pcb->SetElementVisibility( LAYER_MOD_TEXT_BK, true ); Pcb->SetElementVisibility( LAYER_MOD_TEXT_BK, true );
if( !( aPrintMask & LSET::AllCuMask() ).any() ) PCB_LAYER_ID layer = aPrintMask.ExtractLayer();
{
if( onePagePerLayer )
{
// We can print mask layers (solder mask and solder paste) with the actual
// pad sizes. To do that, we must set ContrastModeDisplay to true and set
// the GetScreen()->m_Active_Layer to the current printed layer
displ_opts->m_ContrastModeDisplay = true;
displ_opts->m_DisplayPadFill = true;
// Calculate the active layer number to print from its mask layer: // pads on Silkscreen layer are usually printed in sketch mode:
GetScreen()->m_Active_Layer = B_Cu; if( layer == B_SilkS || layer == F_SilkS )
for( LAYER_NUM id = PCB_LAYER_ID_COUNT-1; id >= 0; --id )
{
if( aPrintMask[id] )
{
GetScreen()->m_Active_Layer = PCB_LAYER_ID( id );
break;
}
}
// pads on Silkscreen layer are usually plot in sketch mode:
if( GetScreen()->m_Active_Layer == B_SilkS ||
GetScreen()->m_Active_Layer == F_SilkS )
{
displ_opts->m_DisplayPadFill = false; displ_opts->m_DisplayPadFill = false;
}
}
else
{
displ_opts->m_DisplayPadFill = false;
}
}
displ_opts->m_DisplayPadNum = false; displ_opts->m_DisplayPadNum = false;