Bug fixes for printing vias.

Blind/buried and microvias didn't get their layers trimmed properly,
nor did through vias with dropped pads.

Fixes https://gitlab.com/kicad/code/kicad/issues/11851
This commit is contained in:
Jeff Young 2022-06-19 11:57:29 +01:00
parent 82ebc247b8
commit 231ac567b8
5 changed files with 12 additions and 7 deletions

View File

@ -132,6 +132,7 @@ void BOARD_PRINTOUT::DrawPage( const wxString& aLayerName, int aPageNum, int aPa
setupPainter( *painter ); setupPainter( *painter );
setupViewLayers( *view, m_settings.m_LayerSet ); setupViewLayers( *view, m_settings.m_LayerSet );
dstSettings->SetPrintLayers( m_settings.m_LayerSet );
dstSettings->SetLayerName( aLayerName ); dstSettings->SetLayerName( aLayerName );

View File

@ -115,6 +115,9 @@ public:
const wxString& GetLayerName() const { return m_layerName; } const wxString& GetLayerName() const { return m_layerName; }
void SetLayerName( const wxString& aLayerName ) { m_layerName = aLayerName; } void SetLayerName( const wxString& aLayerName ) { m_layerName = aLayerName; }
LSET GetPrintLayers() const { return m_printLayers; }
void SetPrintLayers( LSET aLayerSet ) { m_printLayers = aLayerSet; }
/** /**
* Clear the list of active layers. * Clear the list of active layers.
*/ */
@ -329,6 +332,7 @@ protected:
double m_gapLengthRatio; double m_gapLengthRatio;
bool m_isPrinting; bool m_isPrinting;
LSET m_printLayers;
wxDC* m_printDC; // This can go away once the drawing sheet is moved to wxDC* m_printDC; // This can go away once the drawing sheet is moved to
// Cairo-based printing. // Cairo-based printing.

View File

@ -71,7 +71,6 @@ PCB_RENDER_SETTINGS::PCB_RENDER_SETTINGS()
m_ZoneDisplayMode = ZONE_DISPLAY_MODE::SHOW_FILLED; m_ZoneDisplayMode = ZONE_DISPLAY_MODE::SHOW_FILLED;
m_netColorMode = NET_COLOR_MODE::RATSNEST; m_netColorMode = NET_COLOR_MODE::RATSNEST;
m_ContrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL; m_ContrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL;
m_DrawIndividualViaLayers = false;
m_trackOpacity = 1.0; m_trackOpacity = 1.0;
m_viaOpacity = 1.0; m_viaOpacity = 1.0;
@ -840,10 +839,14 @@ void PCB_PAINTER::draw( const PCB_VIA* aVia, int aLayer )
m_gal->SetIsFill( true ); m_gal->SetIsFill( true );
m_gal->DrawCircle( center, getDrillSize( aVia ) / 2.0 ); m_gal->DrawCircle( center, getDrillSize( aVia ) / 2.0 );
} }
else if( aLayer == LAYER_VIA_THROUGH || m_pcbSettings.m_DrawIndividualViaLayers ) else if( aLayer == LAYER_VIA_THROUGH || m_pcbSettings.IsPrinting() )
{ {
int annular_width = ( aVia->GetWidth() - getDrillSize( aVia ) ) / 2.0; int annular_width = ( aVia->GetWidth() - getDrillSize( aVia ) ) / 2.0;
double radius = aVia->GetWidth() / 2.0; double radius = aVia->GetWidth() / 2.0;
bool draw = aLayer == LAYER_VIA_THROUGH;
if( m_pcbSettings.IsPrinting() )
draw = aVia->FlashLayer( m_pcbSettings.GetPrintLayers() );
if( !outline_mode ) if( !outline_mode )
{ {
@ -851,7 +854,8 @@ void PCB_PAINTER::draw( const PCB_VIA* aVia, int aLayer )
radius -= annular_width / 2.0; radius -= annular_width / 2.0;
} }
m_gal->DrawCircle( center, radius ); if( draw )
m_gal->DrawCircle( center, radius );
} }
else if( aLayer == LAYER_VIA_BBLIND || aLayer == LAYER_VIA_MICROVIA ) else if( aLayer == LAYER_VIA_BBLIND || aLayer == LAYER_VIA_MICROVIA )
{ {

View File

@ -120,7 +120,6 @@ public:
ZONE_DISPLAY_MODE m_ZoneDisplayMode; ZONE_DISPLAY_MODE m_ZoneDisplayMode;
HIGH_CONTRAST_MODE m_ContrastModeDisplay; HIGH_CONTRAST_MODE m_ContrastModeDisplay;
bool m_DrawIndividualViaLayers;
protected: protected:
///< Maximum font size for netnames (and other dynamically shown strings) ///< Maximum font size for netnames (and other dynamically shown strings)

View File

@ -260,9 +260,6 @@ void PCBNEW_PRINTOUT::setupPainter( KIGFX::PAINTER& aPainter )
painter.GetSettings()->SetLayerColor( LAYER_VIA_HOLES, COLOR4D::BLACK ); painter.GetSettings()->SetLayerColor( LAYER_VIA_HOLES, COLOR4D::BLACK );
break; break;
} }
painter.GetSettings()->m_DrawIndividualViaLayers =
m_pcbnewSettings.m_Pagination == PCBNEW_PRINTOUT_SETTINGS::LAYER_PER_PAGE;
} }