Fix unconnected schematic net highlighting issue.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16218
(cherry picked from commit 23175c163f
)
This commit is contained in:
parent
6245bbff50
commit
59cc7b2d3e
|
@ -1039,13 +1039,10 @@ int SCH_EDITOR_CONTROL::UpdateNetHighlighting( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
connNames.emplace( selectedName );
|
connNames.emplace( selectedName );
|
||||||
|
|
||||||
if( m_highlightBusMembers )
|
CONNECTION_SUBGRAPH* sg = connectionGraph->FindSubgraphByName( selectedName, sheetPath );
|
||||||
|
|
||||||
|
if( sg && m_highlightBusMembers )
|
||||||
{
|
{
|
||||||
CONNECTION_SUBGRAPH* sg = connectionGraph->FindSubgraphByName( selectedName,
|
|
||||||
sheetPath );
|
|
||||||
|
|
||||||
wxCHECK( sg, 0 );
|
|
||||||
|
|
||||||
for( const SCH_ITEM* item : sg->GetItems() )
|
for( const SCH_ITEM* item : sg->GetItems() )
|
||||||
{
|
{
|
||||||
wxCHECK2( item, continue );
|
wxCHECK2( item, continue );
|
||||||
|
@ -1156,33 +1153,6 @@ int SCH_EDITOR_CONTROL::UpdateNetHighlighting( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
wxCHECK2( itemConn, continue );
|
wxCHECK2( itemConn, continue );
|
||||||
|
|
||||||
bool selectedIsNoNet = false;
|
|
||||||
CONNECTION_SUBGRAPH* selectedSubgraph = nullptr;
|
|
||||||
|
|
||||||
if( itemConn->Driver() == nullptr )
|
|
||||||
{
|
|
||||||
selectedIsNoNet = true;
|
|
||||||
selectedSubgraph = connectionGraph->GetSubgraphForItem( itemConn->Parent() );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( selectedIsNoNet && selectedSubgraph )
|
|
||||||
{
|
|
||||||
for( SCH_ITEM* subgraphItem : selectedSubgraph->GetItems() )
|
|
||||||
{
|
|
||||||
if( !item->IsBrightened() && ( item == subgraphItem ) )
|
|
||||||
{
|
|
||||||
item->SetBrightened();
|
|
||||||
redrawItem = item;
|
|
||||||
}
|
|
||||||
else if( item->IsBrightened() && ( item != subgraphItem ) )
|
|
||||||
{
|
|
||||||
item->ClearBrightened();
|
|
||||||
redrawItem = item;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if( !item->IsBrightened() && connNames.count( itemConn->Name() ) )
|
if( !item->IsBrightened() && connNames.count( itemConn->Name() ) )
|
||||||
{
|
{
|
||||||
item->SetBrightened();
|
item->SetBrightened();
|
||||||
|
@ -1194,7 +1164,6 @@ int SCH_EDITOR_CONTROL::UpdateNetHighlighting( const TOOL_EVENT& aEvent )
|
||||||
redrawItem = item;
|
redrawItem = item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if( redrawItem )
|
if( redrawItem )
|
||||||
itemsToRedraw.push_back( redrawItem );
|
itemsToRedraw.push_back( redrawItem );
|
||||||
|
|
Loading…
Reference in New Issue