PNS: Actually implement the AbortRouting API
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9425
This commit is contained in:
parent
22ba640c2b
commit
153594b9ea
|
@ -705,6 +705,15 @@ void ROUTER::CommitRouting()
|
|||
}
|
||||
|
||||
|
||||
void ROUTER::AbortRouting()
|
||||
{
|
||||
if( m_state == ROUTE_TRACK )
|
||||
m_placer->AbortPlacement();
|
||||
|
||||
StopRouting();
|
||||
}
|
||||
|
||||
|
||||
void ROUTER::StopRouting()
|
||||
{
|
||||
// Update the ratsnest with new changes
|
||||
|
|
|
@ -148,6 +148,7 @@ public:
|
|||
void UndoLastSegment();
|
||||
void CommitRouting();
|
||||
void StopRouting();
|
||||
void AbortRouting();
|
||||
void ClearViewDecorations();
|
||||
|
||||
NODE* GetWorld() const { return m_world.get(); }
|
||||
|
|
|
@ -1144,6 +1144,8 @@ void ROUTER_TOOL::performRouting()
|
|||
// Set initial cursor
|
||||
setCursor();
|
||||
|
||||
bool abortRouting = false;
|
||||
|
||||
while( TOOL_EVENT* evt = Wait() )
|
||||
{
|
||||
setCursor();
|
||||
|
@ -1234,8 +1236,13 @@ void ROUTER_TOOL::performRouting()
|
|||
|| evt->IsUndoRedo()
|
||||
|| evt->IsAction( &PCB_ACTIONS::routerInlineDrag ) )
|
||||
{
|
||||
if( evt->IsCancelInteractive() && !m_router->RoutingInProgress() )
|
||||
m_cancelled = true;
|
||||
if( evt->IsCancelInteractive() )
|
||||
{
|
||||
if( m_router->RoutingInProgress() )
|
||||
abortRouting = true;
|
||||
else
|
||||
m_cancelled = true;
|
||||
}
|
||||
|
||||
if( evt->IsActivate() && !evt->IsMoveTool() )
|
||||
m_cancelled = true;
|
||||
|
@ -1252,7 +1259,10 @@ void ROUTER_TOOL::performRouting()
|
|||
}
|
||||
}
|
||||
|
||||
m_router->CommitRouting();
|
||||
if( abortRouting )
|
||||
m_router->AbortRouting();
|
||||
else
|
||||
m_router->CommitRouting();
|
||||
|
||||
finishInteractive();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue