Loading pcbnew/pcb_painter.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -261,13 +261,14 @@ void PCB_PAINTER::draw( const TRACK* aTrack, int aLayer ) VECTOR2D start( aTrack->GetStart() ); VECTOR2D end( aTrack->GetEnd() ); int width = aTrack->GetWidth(); int netNumber = aTrack->GetNet(); COLOR4D color; if( m_pcbSettings->m_netNamesOnTracks && IsNetnameLayer( aLayer ) ) { int netCode = aTrack->GetNet(); // If there is a net name - display it on the track if( netNumber > 0 ) if( netCode > 0 ) { VECTOR2D line = ( end - start ); double length = line.EuclideanNorm(); Loading @@ -276,11 +277,11 @@ void PCB_PAINTER::draw( const TRACK* aTrack, int aLayer ) if( length < 10 * width ) return; NETINFO_ITEM* net = ( (BOARD*) aTrack->GetParent() )->FindNet( netNumber ); NETINFO_ITEM* net = ( (BOARD*) aTrack->GetParent() )->FindNet( netCode ); if( !net ) return; std::wstring netName = std::wstring( net->GetShortNetname().wc_str() ); wxString netName = net->GetShortNetname(); VECTOR2D textPosition = start + line / 2.0; // center of the track double textOrientation = -atan( line.y / line.x ); double textSize = std::min( static_cast<double>( width ), length / netName.length() ); Loading pcbnew/pcb_painter.h +1 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,7 @@ protected: ///> Colors for all layers (darkened) COLOR4D m_layerColorsDark[TOTAL_LAYER_COUNT]; ///> Flag determining if items on a given layer should be drawn as an outline or a full item bool m_sketchModeSelect[TOTAL_LAYER_COUNT]; ///> Flag determining if pad numbers should be visible Loading Loading
pcbnew/pcb_painter.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -261,13 +261,14 @@ void PCB_PAINTER::draw( const TRACK* aTrack, int aLayer ) VECTOR2D start( aTrack->GetStart() ); VECTOR2D end( aTrack->GetEnd() ); int width = aTrack->GetWidth(); int netNumber = aTrack->GetNet(); COLOR4D color; if( m_pcbSettings->m_netNamesOnTracks && IsNetnameLayer( aLayer ) ) { int netCode = aTrack->GetNet(); // If there is a net name - display it on the track if( netNumber > 0 ) if( netCode > 0 ) { VECTOR2D line = ( end - start ); double length = line.EuclideanNorm(); Loading @@ -276,11 +277,11 @@ void PCB_PAINTER::draw( const TRACK* aTrack, int aLayer ) if( length < 10 * width ) return; NETINFO_ITEM* net = ( (BOARD*) aTrack->GetParent() )->FindNet( netNumber ); NETINFO_ITEM* net = ( (BOARD*) aTrack->GetParent() )->FindNet( netCode ); if( !net ) return; std::wstring netName = std::wstring( net->GetShortNetname().wc_str() ); wxString netName = net->GetShortNetname(); VECTOR2D textPosition = start + line / 2.0; // center of the track double textOrientation = -atan( line.y / line.x ); double textSize = std::min( static_cast<double>( width ), length / netName.length() ); Loading
pcbnew/pcb_painter.h +1 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,7 @@ protected: ///> Colors for all layers (darkened) COLOR4D m_layerColorsDark[TOTAL_LAYER_COUNT]; ///> Flag determining if items on a given layer should be drawn as an outline or a full item bool m_sketchModeSelect[TOTAL_LAYER_COUNT]; ///> Flag determining if pad numbers should be visible Loading