Don't double-up tools on tool stack.
Also make sure move tool gets cancelled by other tools being activated. Fixes https://gitlab.com/kicad/code/kicad/issues/7259
This commit is contained in:
parent
dca7e44455
commit
b576ccef61
|
@ -43,7 +43,15 @@ TOOLS_HOLDER::TOOLS_HOLDER() :
|
|||
// TODO: Implement an RAII mechanism for the stack PushTool/PopTool pairs
|
||||
void TOOLS_HOLDER::PushTool( const std::string& actionName )
|
||||
{
|
||||
if( m_toolStack.size() && m_toolStack.back() == actionName )
|
||||
{
|
||||
// Tool already on the stack; we don't need to push again. (Happens when one tool is
|
||||
// popped due to the activation of the same tool that is underneath it on the stack.)
|
||||
}
|
||||
else
|
||||
{
|
||||
m_toolStack.push_back( actionName );
|
||||
}
|
||||
|
||||
// Human cognitive stacking is very shallow; deeper tool stacks just get annoying
|
||||
if( m_toolStack.size() > 3 )
|
||||
|
|
|
@ -379,13 +379,13 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
//------------------------------------------------------------------------
|
||||
// Handle cancel
|
||||
//
|
||||
else if( evt->IsCancelInteractive() )
|
||||
{
|
||||
if( m_moveInProgress )
|
||||
else if( evt->IsCancelInteractive() || evt->IsActivate() )
|
||||
{
|
||||
if( m_moveInProgress && evt->IsCancelInteractive() )
|
||||
evt->SetPassEvent( false );
|
||||
|
||||
if( m_moveInProgress )
|
||||
restore_state = true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue