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
This commit is contained in:
Seth Hillbrand
2025-08-07 08:25:53 -07:00
parent 6bdfe2bce6
commit 9e326c29db
+5 -8
View File
@@ -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;