Do not allow drag selection or drag move when already moving something

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7800
This commit is contained in:
Jon Evans 2021-03-04 19:01:17 -05:00
parent 6cdc3664ba
commit 4ddb942ec0
3 changed files with 15 additions and 0 deletions

View File

@ -536,6 +536,13 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
} }
else if( evt->IsDrag( BUT_LEFT ) ) else if( evt->IsDrag( BUT_LEFT ) )
{ {
// Is another tool already moving a new object? Don't allow a drag start
if( !m_selection.Empty() && m_selection[0]->HasFlag( IS_NEW | IS_MOVED ) )
{
evt->SetPassEvent();
continue;
}
// drag with LMB? Select multiple objects (or at least draw a selection box) or // drag with LMB? Select multiple objects (or at least draw a selection box) or
// drag them // drag them
if( SCH_EDIT_FRAME* schframe = dynamic_cast<SCH_EDIT_FRAME*>( m_frame ) ) if( SCH_EDIT_FRAME* schframe = dynamic_cast<SCH_EDIT_FRAME*>( m_frame ) )

View File

@ -905,6 +905,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
SCH_ITEM* item = nullptr; SCH_ITEM* item = nullptr;
KIGFX::VIEW_CONTROLS* controls = getViewControls(); KIGFX::VIEW_CONTROLS* controls = getViewControls();
EE_GRID_HELPER grid( m_toolMgr ); EE_GRID_HELPER grid( m_toolMgr );
if( m_inTwoClickPlace ) if( m_inTwoClickPlace )
return 0; return 0;
else else

View File

@ -345,6 +345,13 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
} }
else if( evt->IsDrag( BUT_LEFT ) ) else if( evt->IsDrag( BUT_LEFT ) )
{ {
// Is another tool already moving a new object? Don't allow a drag start
if( !m_selection.Empty() && m_selection[0]->HasFlag( IS_NEW | IS_MOVED ) )
{
evt->SetPassEvent();
continue;
}
// Drag with LMB? Select multiple objects (or at least draw a selection box) // Drag with LMB? Select multiple objects (or at least draw a selection box)
// or drag them // or drag them
m_frame->FocusOnItem( nullptr ); m_frame->FocusOnItem( nullptr );