Eeschema: Check if user wants to warp mouse to origin of moved object

CHANGED: When moving a footprint, Eeschema was always warping the mouse
when moving an item regardless of the state of the "Warp mouse to
origin of moved object" checkbox.  This MR now honors the state of the
checkbox when moving schematic items.

NOTE: Issue 5279 originally only mentioned Pcbnew, but after the fix
for Pcbnew was submitted, a user pointed out it also happened in
Eeschema.  Becuase of this, there are two MRs that "fix" the same issue.

Fixes https://gitlab.com/kicad/code/kicad/issues/5279
This commit is contained in:
PJM 2020-09-17 17:16:08 -07:00 committed by Seth Hillbrand
parent 5feb4d3a7a
commit c8879d9034
1 changed files with 13 additions and 4 deletions

View File

@ -304,6 +304,9 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
} }
else else
{ {
if( m_frame->GetMoveWarpsCursor() )
{
// User wants to warp the mouse
std::vector<SCH_ITEM*> items; std::vector<SCH_ITEM*> items;
for( EDA_ITEM* item : selection ) for( EDA_ITEM* item : selection )
@ -311,6 +314,12 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
m_cursor = grid.BestDragOrigin( m_cursor, items ); m_cursor = grid.BestDragOrigin( m_cursor, items );
} }
else
{
// User does not want to warp the mouse
m_cursor = getViewControls()->GetCursorPosition( true );
}
}
controls->SetCursorPosition( m_cursor, false ); controls->SetCursorPosition( m_cursor, false );