Commit fe341876 authored by Maciej Suminski's avatar Maciej Suminski

bugfix #1326155: pcbnew shows strange ratsnest lines in OpenGL mode.

parent 9305f77f
...@@ -34,8 +34,6 @@ ...@@ -34,8 +34,6 @@
#include <class_board.h> #include <class_board.h>
#include <class_board_item.h> #include <class_board_item.h>
#include <ratsnest_data.h>
BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( BOARD_ITEM* aParent, KICAD_T idtype ) : BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( BOARD_ITEM* aParent, KICAD_T idtype ) :
BOARD_ITEM( aParent, idtype ), m_netinfo( &NETINFO_LIST::ORPHANED ), BOARD_ITEM( aParent, idtype ), m_netinfo( &NETINFO_LIST::ORPHANED ),
m_Subnet( 0 ), m_ZoneSubnet( 0 ) m_Subnet( 0 ), m_ZoneSubnet( 0 )
...@@ -55,29 +53,18 @@ BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( const BOARD_CONNECTED_ITEM& aItem ) ...@@ -55,29 +53,18 @@ BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( const BOARD_CONNECTED_ITEM& aItem )
void BOARD_CONNECTED_ITEM::SetNetCode( int aNetCode ) void BOARD_CONNECTED_ITEM::SetNetCode( int aNetCode )
{ {
BOARD* board = GetBoard(); BOARD* board = GetBoard();
NETINFO_ITEM* oldNetInfo = m_netinfo;
NETINFO_ITEM* newNetInfo;
if( board ) if( board )
{ {
newNetInfo = board->FindNet( aNetCode ); m_netinfo = board->FindNet( aNetCode );
// The requested net does not exist, mark it as unconnected // The requested net does not exist, mark it as unconnected
if( newNetInfo == NULL ) if( m_netinfo == NULL )
newNetInfo = board->FindNet( NETINFO_LIST::UNCONNECTED ); m_netinfo = board->FindNet( NETINFO_LIST::UNCONNECTED );
} }
else else
{ {
// There is no board that contains list of nets, the item is orphaned // There is no board that contains list of nets, the item is orphaned
newNetInfo = &NETINFO_LIST::ORPHANED; m_netinfo = &NETINFO_LIST::ORPHANED;
}
// Update ratsnest, if necessary
if( oldNetInfo != newNetInfo && board )
{
board->GetRatsnest()->Remove( this );
m_netinfo = newNetInfo;
board->GetRatsnest()->Add( this );
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment