Fixed a PNS crash after undoing the last operation while routing

This commit is contained in:
Maciej Suminski 2016-09-23 13:58:33 +02:00
parent 6a9c1cb6a1
commit 3623421912
2 changed files with 11 additions and 6 deletions

View File

@ -299,6 +299,11 @@ public:
return m_actions == TA_ACTIVATE;
}
bool IsUndoRedo() const
{
return m_actions & ( TA_UNDO_REDO_PRE | TA_UNDO_REDO_POST );
}
///> Returns information about key modifiers state (Ctrl, Alt, etc.)
int Modifier( int aMask = MD_MODIFIER_MASK ) const
{

View File

@ -549,9 +549,7 @@ void ROUTER_TOOL::performRouting()
while( OPT_TOOL_EVENT evt = Wait() )
{
if( evt->IsCancel() || evt->IsActivate() )
break;
else if( evt->IsMotion() )
if( evt->IsMotion() )
{
m_router->SetOrthoMode( evt->Modifier( MD_CTRL ) );
updateEndItem( *evt );
@ -605,6 +603,8 @@ void ROUTER_TOOL::performRouting()
still_routing = m_router->FixRoute( m_endSnapPoint, m_endItem );
break;
}
else if( evt->IsCancel() || evt->IsActivate() || evt->IsUndoRedo() )
break;
handleCommonEvents( *evt );
}
@ -764,9 +764,7 @@ void ROUTER_TOOL::performDragging()
{
ctls->ForceCursorPosition( false );
if( evt->IsCancel() || evt->IsActivate() )
break;
else if( evt->IsMotion() )
if( evt->IsMotion() )
{
updateEndItem( *evt );
m_router->Move( m_endSnapPoint, m_endItem );
@ -776,6 +774,8 @@ void ROUTER_TOOL::performDragging()
if( m_router->FixRoute( m_endSnapPoint, m_endItem ) )
break;
}
else if( evt->IsCancel() || evt->IsActivate() || evt->IsUndoRedo() )
break;
handleCommonEvents( *evt );
}