Don't look for connections when we're just clearing the highlight.
This can happen before connectivity has been updated, and the only reason we're looking for it anyway was to make the logic simpler. Fixes https://gitlab.com/kicad/code/kicad/issues/12037
This commit is contained in:
parent
1871812f2b
commit
142229089f
|
@ -1181,11 +1181,14 @@ int SCH_EDITOR_CONTROL::UpdateNetHighlighting( const TOOL_EVENT& aEvent )
|
|||
|
||||
for( SCH_ITEM* item : screen->Items() )
|
||||
{
|
||||
SCH_CONNECTION* itemConn = nullptr;
|
||||
SCH_SYMBOL* symbol = nullptr;
|
||||
bool redraw = item->IsBrightened();
|
||||
bool highlight = false;
|
||||
|
||||
if( selectedConn )
|
||||
{
|
||||
SCH_CONNECTION* itemConn = nullptr;
|
||||
SCH_SYMBOL* symbol = nullptr;
|
||||
|
||||
if( item->Type() == SCH_SYMBOL_T )
|
||||
symbol = static_cast<SCH_SYMBOL*>( item );
|
||||
|
||||
|
@ -1216,9 +1219,9 @@ int SCH_EDITOR_CONTROL::UpdateNetHighlighting( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
else if( member->IsBus() )
|
||||
{
|
||||
for( const std::shared_ptr<SCH_CONNECTION>& child_member : member->Members() )
|
||||
for( const std::shared_ptr<SCH_CONNECTION>& bus_member : member->Members() )
|
||||
{
|
||||
if( child_member->Name() == itemConn->Name() )
|
||||
if( bus_member->Name() == itemConn->Name() )
|
||||
{
|
||||
highlight = true;
|
||||
break;
|
||||
|
@ -1231,6 +1234,7 @@ int SCH_EDITOR_CONTROL::UpdateNetHighlighting( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
highlight = true;
|
||||
}
|
||||
}
|
||||
|
||||
if( highlight )
|
||||
item->SetBrightened();
|
||||
|
@ -1239,9 +1243,10 @@ int SCH_EDITOR_CONTROL::UpdateNetHighlighting( const TOOL_EVENT& aEvent )
|
|||
|
||||
redraw |= item->IsBrightened();
|
||||
|
||||
// symbol is only non-null if the item is a SCH_SYMBOL_T
|
||||
if( symbol )
|
||||
if( item->Type() == SCH_SYMBOL_T )
|
||||
{
|
||||
SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
|
||||
|
||||
redraw |= symbol->HasBrightenedPins();
|
||||
|
||||
symbol->ClearBrightenedPins();
|
||||
|
|
Loading…
Reference in New Issue