diff --git a/common/board_printout.cpp b/common/board_printout.cpp index 94c991bd64..a03e35b6ff 100644 --- a/common/board_printout.cpp +++ b/common/board_printout.cpp @@ -132,6 +132,7 @@ void BOARD_PRINTOUT::DrawPage( const wxString& aLayerName, int aPageNum, int aPa setupPainter( *painter ); setupViewLayers( *view, m_settings.m_LayerSet ); + dstSettings->SetPrintLayers( m_settings.m_LayerSet ); dstSettings->SetLayerName( aLayerName ); diff --git a/include/render_settings.h b/include/render_settings.h index 4fb2e6506e..841aba7b12 100644 --- a/include/render_settings.h +++ b/include/render_settings.h @@ -115,6 +115,9 @@ public: const wxString& GetLayerName() const { return m_layerName; } 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. */ @@ -329,6 +332,7 @@ protected: double m_gapLengthRatio; bool m_isPrinting; + LSET m_printLayers; wxDC* m_printDC; // This can go away once the drawing sheet is moved to // Cairo-based printing. diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 75730b2746..ec9f15114f 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -71,7 +71,6 @@ PCB_RENDER_SETTINGS::PCB_RENDER_SETTINGS() m_ZoneDisplayMode = ZONE_DISPLAY_MODE::SHOW_FILLED; m_netColorMode = NET_COLOR_MODE::RATSNEST; m_ContrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL; - m_DrawIndividualViaLayers = false; m_trackOpacity = 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->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; 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 ) { @@ -851,7 +854,8 @@ void PCB_PAINTER::draw( const PCB_VIA* aVia, int aLayer ) 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 ) { diff --git a/pcbnew/pcb_painter.h b/pcbnew/pcb_painter.h index 2c95cf6c0a..b211a227c8 100644 --- a/pcbnew/pcb_painter.h +++ b/pcbnew/pcb_painter.h @@ -120,7 +120,6 @@ public: ZONE_DISPLAY_MODE m_ZoneDisplayMode; HIGH_CONTRAST_MODE m_ContrastModeDisplay; - bool m_DrawIndividualViaLayers; protected: ///< Maximum font size for netnames (and other dynamically shown strings) diff --git a/pcbnew/pcbnew_printout.cpp b/pcbnew/pcbnew_printout.cpp index ba58224cdf..9ffae36325 100644 --- a/pcbnew/pcbnew_printout.cpp +++ b/pcbnew/pcbnew_printout.cpp @@ -260,9 +260,6 @@ void PCBNEW_PRINTOUT::setupPainter( KIGFX::PAINTER& aPainter ) painter.GetSettings()->SetLayerColor( LAYER_VIA_HOLES, COLOR4D::BLACK ); break; } - - painter.GetSettings()->m_DrawIndividualViaLayers = - m_pcbnewSettings.m_Pagination == PCBNEW_PRINTOUT_SETTINGS::LAYER_PER_PAGE; }