Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 28089) +++ trunk/src/crosshair.c (revision 28090) @@ -780,7 +780,7 @@ } } -static void check_snap_offgrid_line(struct snap_data *snap_data, pcb_coord_t nearest_grid_x, pcb_coord_t nearest_grid_y) +static void check_snap_offgrid_line(pcb_board_t *pcb, struct snap_data *snap_data, pcb_coord_t nearest_grid_x, pcb_coord_t nearest_grid_y) { void *ptr1, *ptr2, *ptr3; int ans; @@ -803,7 +803,7 @@ line = (pcb_line_t *) ptr2; - if (!pcb_tool_should_snap_offgrid_line(ptr1, line)) + if (!pcb_tool_should_snap_offgrid_line(pcb, ptr1, line)) return; dx = line->Point2.X - line->Point1.X; @@ -953,7 +953,7 @@ * Snap to offgrid points on lines. */ if (conf_core.editor.snap_offgrid_line) - check_snap_offgrid_line(&snap_data, nearest_grid_x, nearest_grid_y); + check_snap_offgrid_line(PCB, &snap_data, nearest_grid_x, nearest_grid_y); ans = PCB_OBJ_VOID; if (conf_core.editor.snap_pin) Index: trunk/src/tool.c =================================================================== --- trunk/src/tool.c (revision 28089) +++ trunk/src/tool.c (revision 28090) @@ -350,13 +350,13 @@ pcb_notify_crosshair_change(pcb_true); } -pcb_bool pcb_tool_should_snap_offgrid_line(pcb_layer_t *layer, pcb_line_t *line) +pcb_bool pcb_tool_should_snap_offgrid_line(pcb_board_t *pcb, pcb_layer_t *layer, pcb_line_t *line) { /* Allow snapping to off-grid lines when drawing new lines (on * the same layer), and when moving a line end-point * (but don't snap to the same line) */ - if ((pcbhl_conf.editor.mode == PCB_MODE_LINE && CURRENT == layer) || + if ((pcbhl_conf.editor.mode == PCB_MODE_LINE && PCB_CURRLAYER(pcb) == layer) || (pcbhl_conf.editor.mode == PCB_MODE_MOVE && pcb_crosshair.AttachedObject.Type == PCB_OBJ_LINE_POINT && pcb_crosshair.AttachedObject.Ptr1 == layer Index: trunk/src/tool.h =================================================================== --- trunk/src/tool.h (revision 28089) +++ trunk/src/tool.h (revision 28090) @@ -148,7 +148,7 @@ void pcb_tool_attach_for_copy(pcb_hidlib_t *hl, pcb_coord_t PlaceX, pcb_coord_t PlaceY, pcb_bool do_rubberband); void pcb_tool_notify_block(void); /* create first or second corner of a marked block (when clicked) */ -pcb_bool pcb_tool_should_snap_offgrid_line(pcb_layer_t *layer, pcb_line_t *line); +pcb_bool pcb_tool_should_snap_offgrid_line(pcb_board_t *pcb, pcb_layer_t *layer, pcb_line_t *line); /**** old helpers ****/