Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 33522) +++ trunk/src/crosshair.c (revision 33523) @@ -1048,9 +1048,17 @@ enfmode = (rnd_conf.editor.mode == pcb_crosshair.tool_line) && pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST; if (pcb_brave & PCB_BRAVE_ENFORCE_CLR_MOVE) enfmode |= (rnd_conf.editor.mode == pcb_crosshair.tool_move) && (pcb_crosshair.AttachedObject.Type == PCB_OBJ_LINE_POINT); - if (enfmode && conf_core.editor.auto_drc) - pcb_line_enforce_drc(pcb); + if (enfmode && conf_core.editor.auto_drc) { + rnd_coord_t thick; + + if (rnd_conf.editor.mode == pcb_crosshair.tool_move) + thick = pcb_crosshair.AttachedLine.tot_thick; + else + thick = conf_core.design.line_thickness + 2 * (conf_core.design.clearance + 1); + pcb_line_enforce_drc(pcb, thick); + } + rnd_gui->set_crosshair(rnd_gui, pcb_crosshair.X, pcb_crosshair.Y, HID_SC_DO_NOTHING); } Index: trunk/src/obj_line.h =================================================================== --- trunk/src/obj_line.h (revision 33522) +++ trunk/src/obj_line.h (revision 33523) @@ -42,6 +42,7 @@ /* crosshair: */ typedef struct { /* current marked line */ rnd_point_t Point1, Point2; /* start- and end-position */ + rnd_coord_t tot_thick; /* total thickness, with clearance included */ long int State; rnd_bool draw; } pcb_attached_line_t; @@ -97,7 +98,7 @@ /* makes the attached line fit into a 45 degree direction */ void pcb_line_45(pcb_attached_line_t *); -void pcb_line_enforce_drc(pcb_board_t *pcb); +void pcb_line_enforce_drc(pcb_board_t *pcb, rnd_coord_t thick); /* Calculate a pair of refractioned (ortho-45) lines between 'start' and 'end'. If 'mid_out' is not NULL, load it with the coords of the middle point. @@ -114,7 +115,7 @@ the fields of 'end' needed to find the closest point to the original target that still won't hit any object. Returns the straigh-line distance between start and the new end. */ -double pcb_drc_lines(pcb_board_t *pcb, const rnd_point_t *start, rnd_point_t *end, rnd_point_t *mid_out, rnd_bool way, rnd_bool optimize); +double pcb_drc_lines(pcb_board_t *pcb, const rnd_point_t *start, rnd_point_t *end, rnd_point_t *mid_out, rnd_bool way, rnd_bool optimize, rnd_coord_t tot_thick); /*** decide if two liens are overlapping in a way they can be simplified ***/ typedef enum { Index: trunk/src/obj_line_drcenf.c =================================================================== --- trunk/src/obj_line_drcenf.c (revision 33522) +++ trunk/src/obj_line_drcenf.c (revision 33523) @@ -225,7 +225,7 @@ return RND_R_DIR_FOUND_CONTINUE; } -double pcb_drc_lines(pcb_board_t *pcb, const rnd_point_t *start, rnd_point_t *end, rnd_point_t *mid_out, rnd_bool way, rnd_bool optimize) +double pcb_drc_lines(pcb_board_t *pcb, const rnd_point_t *start, rnd_point_t *end, rnd_point_t *mid_out, rnd_bool way, rnd_bool optimize, rnd_coord_t tot_thick) { double f, s, f2, s2, len, best; rnd_coord_t dx, dy, temp, last, length; @@ -243,7 +243,7 @@ line1.Flags = line2.Flags = pcb_no_flags(); line1.parent_type = line2.parent_type = PCB_PARENT_LAYER; line1.parent.layer = line2.parent.layer = PCB_CURRLAYER(PCB); - line1.Thickness = conf_core.design.line_thickness + 2 * (conf_core.design.clearance + 1); + line1.Thickness = tot_thick; line2.Thickness = line1.Thickness; line1.Clearance = line2.Clearance = 0; line1.Point1.X = start->X; @@ -458,7 +458,7 @@ end->Y = last_good.Y; } -void pcb_line_enforce_drc(pcb_board_t *pcb) +void pcb_line_enforce_drc(pcb_board_t *pcb, rnd_coord_t tot_thick) { rnd_point_t r45, rs, start; rnd_bool shift; @@ -480,9 +480,9 @@ if (conf_core.editor.line_refraction != 0) { /* first try starting straight */ - r1 = pcb_drc_lines(pcb, &start, &rs, NULL, rnd_false, rnd_true); + r1 = pcb_drc_lines(pcb, &start, &rs, NULL, rnd_false, rnd_true, tot_thick); /* then try starting at 45 */ - r2 = pcb_drc_lines(pcb, &start, &r45, NULL, rnd_true, rnd_true); + r2 = pcb_drc_lines(pcb, &start, &r45, NULL, rnd_true, rnd_true, tot_thick); } else { drc_line(&rs); Index: trunk/src/tool_logic.c =================================================================== --- trunk/src/tool_logic.c (revision 33522) +++ trunk/src/tool_logic.c (revision 33523) @@ -143,6 +143,7 @@ if (conf_core.editor.auto_drc && (pcb_crosshair.AttachedObject.Type == PCB_OBJ_LINE_POINT) && (rnd_conf.editor.mode == pcb_crosshair.tool_move) && (pcb_brave & PCB_BRAVE_ENFORCE_CLR_MOVE)) { pcb_find_t fctx; + pcb_line_t *line; /* clearance enforce on move: need to do a find on the given object to avoid self-intersect blocks on the same network */ memset(&fctx, 0, sizeof(fctx)); @@ -154,6 +155,13 @@ /* set up the startpoint for the drc line enforcer */ pcb_crosshair.AttachedLine.Point1.X = PlaceX; pcb_crosshair.AttachedLine.Point1.Y = PlaceY; + + /* set line total thickness for enforcing the endpoint move gap */ + line = pcb_crosshair.AttachedObject.Ptr2; + if ((line != NULL) && (line->type == PCB_OBJ_LINE)) + pcb_crosshair.AttachedLine.tot_thick = line->Thickness + line->Clearance+1; + else + pcb_crosshair.AttachedLine.tot_thick = conf_core.design.line_thickness + 2 * (conf_core.design.clearance + 1); } rnd_event(hl, PCB_EVENT_RUBBER_RESET, NULL);