From 44861f5889b3067856bc12dd9b68fdbaeaac36bd Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 3 Feb 2014 13:05:27 +0100 Subject: [PATCH] Fixed tracks of 0 width causing division by 0 error. --- pcbnew/class_track.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index 21cca65517..79863c19f2 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -763,9 +763,9 @@ void TRACK::ViewGetLayers( int aLayers[], int& aCount ) const unsigned int TRACK::ViewGetLOD( int aLayer ) const { // Netnames will be shown only if zoom is appropriate - if( aLayer == GetNetnameLayer( GetLayer() ) ) + if( aLayer == ITEM_GAL_LAYER( TRACK_NETNAMES_VISIBLE ) ) { - return ( 20000000 / m_Width ); + return ( 20000000 / ( m_Width + 1 ) ); } // Other layers are shown without any conditions