diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index e016c277c9..34d4536c31 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -1018,6 +1018,18 @@ void VIA::ViewGetLayers( int aLayers[], int& aCount ) const } +unsigned int VIA::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const +{ + BOARD* board = GetBoard(); + + // Only draw the via if at least one of the layers it crosses is being displayed + if( board && ( board->GetVisibleLayers() & GetLayerSet() ).any() ) + return 0; + + return std::numeric_limits::max(); +} + + // see class_track.h void TRACK::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ) { diff --git a/pcbnew/class_track.h b/pcbnew/class_track.h index 4cfa369f1b..a9e3e887df 100644 --- a/pcbnew/class_track.h +++ b/pcbnew/class_track.h @@ -434,6 +434,9 @@ public: /// @copydoc VIEW_ITEM::ViewGetLayers() virtual void ViewGetLayers( int aLayers[], int& aCount ) const override; + /// @copydoc VIEW_ITEM::ViewGetLOD() + virtual unsigned int ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override; + virtual void Flip( const wxPoint& aCentre ) override; #if defined (DEBUG) diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 9f0a266555..60ea4aa156 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -393,11 +393,6 @@ void PCB_PAINTER::draw( const VIA* aVia, int aLayer ) VECTOR2D center( aVia->GetStart() ); double radius = 0.0; - // Only draw the via if at least one of the layers it crosses is being displayed - BOARD* brd = aVia->GetBoard( ); - if( !( brd->GetVisibleLayers() & aVia->GetLayerSet() ).any() ) - return; - // Choose drawing settings depending on if we are drawing via's pad or hole if( aLayer == LAYER_VIAS_HOLES ) radius = aVia->GetDrillValue() / 2.0;