PCB: fix stale ratsnest between moves in Move Individually

This commit is contained in:
Mike Williams 2022-11-30 09:11:03 -05:00
parent 03f79f512c
commit 17bb57cc73
3 changed files with 13 additions and 0 deletions

View File

@ -2545,6 +2545,14 @@ int EDIT_TOOL::cutToClipboard( const TOOL_EVENT& aEvent )
}
void EDIT_TOOL::rebuildConnectivity()
{
board()->BuildConnectivity();
m_toolMgr->PostEvent( EVENTS::ConnectivityChangedEvent );
canvas()->RedrawRatsnest();
}
void EDIT_TOOL::setTransitions()
{
Go( &EDIT_TOOL::GetAndPlace, PCB_ACTIONS::getAndPlace.MakeEvent() );

View File

@ -200,6 +200,9 @@ private:
bool pickReferencePoint( const wxString& aTooltip, const wxString& aSuccessMessage,
const wxString& aCanceledMessage, VECTOR2I& aReferencePoint );
///< Rebuilds the ratsnest for operations that require it outside the commit rebuild
void rebuildConnectivity();
private:
PCB_SELECTION_TOOL* m_selectionTool;
std::unique_ptr<BOARD_COMMIT> m_commit;

View File

@ -742,6 +742,8 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent )
if( isSkip )
orig_items[itemIdx]->SetPosition( originalPos );
rebuildConnectivity();
if( ++itemIdx < orig_items.size() )
{
m_selectionTool->ClearSelection();