Browse Source

Move update-wires-if-driver-changed logic.

This prevents RecalculateConnections from getting called twice before
we run the logic.  In that case the driver would change on the first
recalc, and then it would look like it didn't change on the second (which
is where we were checking).

Fixes https://gitlab.com/kicad/code/kicad/issues/8812
6.0.7
Jeff Young 4 years ago
parent
commit
29eece7409
  1. 40
      eeschema/sch_edit_frame.cpp

40
eeschema/sch_edit_frame.cpp

@ -793,26 +793,6 @@ void SCH_EDIT_FRAME::OnModify()
if( ADVANCED_CFG::GetCfg().m_RealTimeConnectivity && CONNECTION_GRAPH::m_allowRealTime )
RecalculateConnections( NO_CLEANUP );
GetCanvas()->GetView()->UpdateAllItemsConditionally( KIGFX::REPAINT,
[]( KIGFX::VIEW_ITEM* aItem )
{
SCH_ITEM* item = dynamic_cast<SCH_ITEM*>( aItem );
SCH_CONNECTION* connection = item ? item->Connection() : nullptr;
if( connection && connection->HasDriverChanged() )
{
connection->ClearDriverChanged();
return true;
}
EDA_TEXT* text = dynamic_cast<EDA_TEXT*>( aItem );
if( text && text->HasTextVars() )
return true;
return false;
} );
GetCanvas()->Refresh();
UpdateHierarchyNavigator();
@ -1342,6 +1322,26 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags )
Schematic().ConnectionGraph()->Recalculate( list, true, &changeHandler );
GetCanvas()->GetView()->UpdateAllItemsConditionally( KIGFX::REPAINT,
[]( KIGFX::VIEW_ITEM* aItem )
{
SCH_ITEM* item = dynamic_cast<SCH_ITEM*>( aItem );
SCH_CONNECTION* connection = item ? item->Connection() : nullptr;
if( connection && connection->HasDriverChanged() )
{
connection->ClearDriverChanged();
return true;
}
EDA_TEXT* text = dynamic_cast<EDA_TEXT*>( aItem );
if( text && text->HasTextVars() )
return true;
return false;
} );
if( highlightedItem )
SetHighlightedConnection( highlightedItem->Connection( &highlightPath ) );
}

Loading…
Cancel
Save