From dfccd8c5e405d3931630a022bca508414e20807d Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Sat, 3 Nov 2018 00:47:57 +0100 Subject: [PATCH] Added level-of-details threshold for via net name layer --- pcbnew/class_track.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index 81fc242672..82d8a369c5 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -1031,13 +1031,20 @@ void VIA::ViewGetLayers( int aLayers[], int& aCount ) const unsigned int VIA::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const { + constexpr unsigned int HIDE = std::numeric_limits::max(); + + // Netnames will be shown only if zoom is appropriate + if( IsNetnameLayer( aLayer ) ) + return m_Width == 0 ? HIDE : ( Millimeter2iu( 10 ) / m_Width ); + + 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(); + return HIDE; }