Browse Source

Disable snap when moving with keyboard

Keyboard movement is for precision control, so avoid snapping behavior

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21235
pull/18/head
Seth Hillbrand 2 months ago
parent
commit
9e326c29db
  1. 13
      pcbnew/tools/edit_tool_move_fct.cpp

13
pcbnew/tools/edit_tool_move_fct.cpp

@ -494,16 +494,13 @@ bool EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, BOARD_COMMIT* aCommit
if( controls->GetSettings().m_lastKeyboardCursorPositionValid )
{
long action = controls->GetSettings().m_lastKeyboardCursorCommand;
// The arrow keys are by definition SINGLE AXIS. Do not allow the other
// axis to be snapped to the grid.
if( action == ACTIONS::CURSOR_LEFT || action == ACTIONS::CURSOR_RIGHT )
m_cursor.y = prevPos.y;
else if( action == ACTIONS::CURSOR_UP || action == ACTIONS::CURSOR_DOWN )
m_cursor.x = prevPos.x;
grid.SetSnap( false );
grid.SetUseGrid( false );
}
m_cursor = grid.BestSnapAnchor( mousePos, layers,
grid.GetSelectionGrid( selection ), sel_items );
if( !selection.HasReferencePoint() )
originalPos = m_cursor;

Loading…
Cancel
Save