Update dangling ends when dragging block.

This commit is contained in:
Jeff Young 2019-04-26 20:46:41 +01:00
parent 1c8461bec7
commit a80f7432b7
1 changed files with 18 additions and 0 deletions

View File

@ -203,6 +203,21 @@ int SCH_EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
m_frame->SaveCopyInUndoList( item, UR_CHANGED, i > 0 );
}
// Mark dangling pins at the edges of the block:
std::vector<DANGLING_END_ITEM> internalPoints;
for( int i = 0; i < selection.GetSize(); ++i )
{
SCH_ITEM* item = static_cast<SCH_ITEM*>( selection.GetItem( i ) );
item->GetEndPoints( internalPoints );
}
for( int i = 0; i < selection.GetSize(); ++i )
{
SCH_ITEM* item = static_cast<SCH_ITEM*>( selection.GetItem( i ) );
item->UpdateDanglingState( internalPoints );
}
m_cursor = controls->GetCursorPosition();
if( selection.HasReferencePoint() )
@ -301,7 +316,10 @@ int SCH_EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
if( restore_state )
m_frame->RollbackSchematicFromUndo();
else
{
m_frame->TestDanglingEnds();
m_frame->OnModify();
}
return 0;
}