From dc20e24c4a5fec2e84c1093506b9f570d1f7be89 Mon Sep 17 00:00:00 2001 From: Mike Williams Date: Wed, 17 Aug 2022 14:47:56 -0400 Subject: [PATCH] Route Other End: Perform Steps in one Undo Commit --- pcbnew/router/router_tool.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 8ef4941e04..aa4c58aa88 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -1281,7 +1281,13 @@ void ROUTER_TOOL::performRouting() int currentLayer = m_router->GetCurrentLayer(); // Commit whatever we've fixed and restart routing from the other end - m_router->CommitRouting(); + if( m_router->Placer()->HasPlacedAnything() ) + { + m_router->CommitRouting(); + m_iface->SetCommitFlags( APPEND_UNDO ); + } + else + m_router->StopRouting(); if( otherEndLayers.Overlaps( currentLayer ) ) m_router->StartRouting( otherEnd, ¤t, currentLayer ); @@ -1397,6 +1403,8 @@ void ROUTER_TOOL::performRouting() } m_router->CommitRouting(); + // Reset to normal for next route + m_iface->SetCommitFlags( 0 ); finishInteractive(); }