From eb449879b85ebb56be6f2ebd080819c974861c25 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 5 Jun 2014 09:55:35 +0200 Subject: [PATCH] bugfix #1326155: pcbnew shows strange ratsnest lines in OpenGL mode. --- pcbnew/class_board_connected_item.cpp | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/pcbnew/class_board_connected_item.cpp b/pcbnew/class_board_connected_item.cpp index de349b26fd..d7c54e7925 100644 --- a/pcbnew/class_board_connected_item.cpp +++ b/pcbnew/class_board_connected_item.cpp @@ -34,8 +34,6 @@ #include #include -#include - BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( BOARD_ITEM* aParent, KICAD_T idtype ) : BOARD_ITEM( aParent, idtype ), m_netinfo( &NETINFO_LIST::ORPHANED ), m_Subnet( 0 ), m_ZoneSubnet( 0 ) @@ -55,29 +53,18 @@ BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( const BOARD_CONNECTED_ITEM& aItem ) void BOARD_CONNECTED_ITEM::SetNetCode( int aNetCode ) { BOARD* board = GetBoard(); - NETINFO_ITEM* oldNetInfo = m_netinfo; - NETINFO_ITEM* newNetInfo; - if( board ) { - newNetInfo = board->FindNet( aNetCode ); + m_netinfo = board->FindNet( aNetCode ); // The requested net does not exist, mark it as unconnected - if( newNetInfo == NULL ) - newNetInfo = board->FindNet( NETINFO_LIST::UNCONNECTED ); + if( m_netinfo == NULL ) + m_netinfo = board->FindNet( NETINFO_LIST::UNCONNECTED ); } else { // There is no board that contains list of nets, the item is orphaned - newNetInfo = &NETINFO_LIST::ORPHANED; - } - - // Update ratsnest, if necessary - if( oldNetInfo != newNetInfo && board ) - { - board->GetRatsnest()->Remove( this ); - m_netinfo = newNetInfo; - board->GetRatsnest()->Add( this ); + m_netinfo = &NETINFO_LIST::ORPHANED; } }