When 'Find-moving' modules in GAL, pick up at origin

Perviously, the generic snapping code would choose the nearest of the
module origin and origin of each module pad when selecting a module
using the "Find module" tool (T hotkey).

This is unlikely to be expected unless the cursor is already near the
correct pad or the module centre.

New behaviour is to pick up by module origin first, then
select the module. This means that the cursor is already nearest the
main module origin anchor, so that is what will be used.

Fixes: lp:1571214
* https://bugs.launchpad.net/kicad/+bug/1571214
This commit is contained in:
John Beard 2017-02-06 18:16:36 +08:00 committed by Chris Pavlina
parent a5dcc192dc
commit cdc392867a
1 changed files with 8 additions and 0 deletions

View File

@ -679,6 +679,14 @@ int SELECTION_TOOL::findMove( const TOOL_EVENT& aEvent )
{
clearSelection();
toggleSelection( module );
// Place event on module origin first, so the generic anchor snap
// doesn't just choose the closest pin for us
// Don't warp the view - we want the component to
// "teleport" to cursor, not move to the components position
getViewControls()->ForceCursorPosition( true, module->GetPosition() );
// pick the component up and start moving
m_toolMgr->InvokeTool( "pcbnew.InteractiveEdit" );
}