← Back to team overview

kicad-developers team mailing list archive

Patch: don't snap to grid if deleting in pcbnew

 

Occasionally, I get a trace that passes between grid points
without ever covering one. If I want to delete or modify
this trace, I need to change the grid, make the change, and
then change the grid back. This is a bit awkward,
particularly if you don't have a mouse wheel.

The following patch avoids this detour by simply turning off
snap-to-grid when deleting. As far as I can tell, there
should be no situation where one would actually need the
grid in this mode anyway.

- Werner

--- kicad-dev/pcbnew/controle.cpp.orig	2006-06-12 22:11:36.000000000 -0300
+++ kicad-dev/pcbnew/controle.cpp	2006-06-12 22:12:35.000000000 -0300
@@ -268,16 +268,16 @@ int CurrentTime = time(NULL);
if ( (m_ID_current_state != ID_TRACK_BUTT ) &&
(g_MagneticPadOption == capture_cursor_in_track_tool) )
pad = NULL;
-	if (pad)	// Put cursor on the pad
+	if (pad) {	// Put cursor on the pad
GetScreen()->m_Curseur = curpos = pad->m_Pos;
-	else { /* Put On Grid */
-	PutOnGrid( & GetScreen()->m_Curseur);
-	}
-	break;
+	break;
+	}
+	/* fall through */

case no_effect: /* Always Put cursor On Grid */
default:
-	PutOnGrid( & GetScreen()->m_Curseur);
+	if (m_ID_current_state != ID_PCB_DELETE_ITEM_BUTT)
+	PutOnGrid( & GetScreen()->m_Curseur);
break;
}

-- 
_________________________________________________________________________
/ Werner Almesberger, Buenos Aires, Argentina werner@... /
/_http://www.almesberger.net/____________________________________________/