Browse Source

Don't exit group when the cancel went to another tool.

Also fixes a bug where the group border didn't get updated immediately
on enter/exit.

Fixes https://gitlab.com/kicad/code/kicad/issues/12669
7.0
Jeff Young 3 years ago
parent
commit
403cc50e7c
  1. 14
      pcbnew/tools/pcb_selection_tool.cpp

14
pcbnew/tools/pcb_selection_tool.cpp

@ -447,16 +447,17 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
m_disambiguateTimer.Stop();
m_frame->FocusOnItem( nullptr );
if( m_enteredGroup )
if( !GetSelection().Empty() )
{
ExitGroup();
ClearSelection();
}
else if( !GetSelection().Empty() )
else if( evt->FirstResponder() == this && evt->GetCommandId() == (int) WXK_ESCAPE )
{
ClearSelection();
if( m_enteredGroup )
{
ExitGroup();
}
else if( evt->FirstResponder() == this && evt->GetCommandId() == (int) WXK_ESCAPE )
else
{
BOARD_INSPECTION_TOOL* controller = m_toolMgr->GetTool<BOARD_INSPECTION_TOOL>();
@ -464,6 +465,7 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
controller->ClearHighlight( *evt );
}
}
}
else
{
evt->SetPassEvent();
@ -514,6 +516,7 @@ void PCB_SELECTION_TOOL::EnterGroup()
} );
m_enteredGroupOverlay.Add( m_enteredGroup );
view()->Update( &m_enteredGroupOverlay );
}
@ -531,6 +534,7 @@ void PCB_SELECTION_TOOL::ExitGroup( bool aSelectGroup )
m_enteredGroupOverlay.Clear();
m_enteredGroup = nullptr;
view()->Update( &m_enteredGroupOverlay );
}

Loading…
Cancel
Save