Index: trunk/src/Makefile.dep =================================================================== --- trunk/src/Makefile.dep (revision 11821) +++ trunk/src/Makefile.dep (revision 11822) @@ -179,14 +179,15 @@ rats_patch.h board.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \ route.h buffer.h obj_subc_list.h obj_subc.h \ ../src_3rd/libminuid/libminuid.h ../src_3rd/genht/htsp.h rtree.h \ - ht_subc.h layer.h ../src_plugins/diag/diag_conf.h conf.h pcb-printf.h \ - ../src_3rd/genvector/gds_char.h ../src_3rd/liblihata/lihata.h \ - ../src_3rd/liblihata/dom.h ../src_3rd/liblihata/lihata.h \ - ../src_3rd/liblihata/parser.h ../src_3rd/genvector/vtp0.h list_conf.h \ - conf.h action_helper.h hid_actions.h plugins.h \ - ../src_3rd/puplug/puplug.h ../src_3rd/puplug/libs.h \ - ../src_3rd/puplug/os_dep.h ../src_3rd/puplug/config.h \ - ../src_3rd/puplug/libs.h ../src_3rd/puplug/error.h error.h event.h \ + ht_subc.h flag_str.h layer.h ../src_plugins/diag/diag_conf.h conf.h \ + pcb-printf.h ../src_3rd/genvector/gds_char.h \ + ../src_3rd/liblihata/lihata.h ../src_3rd/liblihata/dom.h \ + ../src_3rd/liblihata/lihata.h ../src_3rd/liblihata/parser.h \ + ../src_3rd/genvector/vtp0.h list_conf.h conf.h action_helper.h \ + hid_actions.h plugins.h ../src_3rd/puplug/puplug.h \ + ../src_3rd/puplug/libs.h ../src_3rd/puplug/os_dep.h \ + ../src_3rd/puplug/config.h ../src_3rd/puplug/libs.h \ + ../src_3rd/puplug/error.h error.h event.h \ ../src_plugins/diag/integrity.h hid.h hid_attrib.h hid_dad.h \ compat_misc.h hid_attrib.h dolists.h \ ../src_plugins/diag/diag_conf_fields.h @@ -6511,7 +6512,8 @@ crosshair.h vtonpoint.h hid.h error.h drc.h route.h buffer.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h rtree.h \ ht_subc.h find.h polygon.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ - obj_line_draw.h obj_arc_draw.h obj_line_op.h operation.h + obj_line_draw.h obj_arc_draw.h obj_line_op.h operation.h \ + draw_wireframe.h route_style.o: route_style.c ../config.h pcb-printf.h \ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \ ../src_3rd/genvector/genvector_undef.h unit.h route_style.h \ Index: trunk/src/draw_wireframe.h =================================================================== --- trunk/src/draw_wireframe.h (revision 11821) +++ trunk/src/draw_wireframe.h (revision 11822) @@ -53,15 +53,13 @@ */ static inline PCB_FUNC_UNUSED void pcb_draw_wireframe_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, pcb_coord_t thick) { - pcb_coord_t dx, dy, ox, oy; - - dx = x2 - x1; - dy = y2 - y1; - if ((dx != 0) || (dy != 0)) { + if((x1 != x2) || (y1 != y2)) { + double dx = x2 - x1; + double dy = y2 - y1; double h = 0.5 * thick / sqrt(PCB_SQUARE(dx) + PCB_SQUARE(dy)); + pcb_coord_t ox = dy * h + 0.5 * SGN(dy); + pcb_coord_t oy = -(dx * h + 0.5 * SGN(dx)); - ox = dy * h + 0.5 * SGN(dy); - oy = -(dx * h + 0.5 * SGN(dx)); if (coord_abs(ox) >= pcb_pixel_slop || coord_abs(oy) >= pcb_pixel_slop) { pcb_angle_t angle = atan2(dx, dy) * 57.295779; pcb_gui->draw_line(gc, x1 + ox, y1 + oy, x2 + ox, y2 + oy); Index: trunk/src/route.c =================================================================== --- trunk/src/route.c (revision 11821) +++ trunk/src/route.c (revision 11822) @@ -40,8 +40,8 @@ #include "obj_arc_draw.h" #include "obj_line.h" #include "obj_line_op.h" +#include "draw_wireframe.h" - void pcb_route_init(pcb_route_t * p_route) { @@ -555,33 +555,6 @@ *===========================================================================*/ /*----------------------------------------------------------- - * Draws the outline of a line - *---------------------------------------------------------*/ -void -pcb_route_draw_line(pcb_hid_gc_t GC, - pcb_coord_t x1, - pcb_coord_t y1, - pcb_coord_t x2, - pcb_coord_t y2, - pcb_coord_t thickness ) -{ - pcb_coord_t dx = x2 - x1; - pcb_coord_t dy = y2 - y1; - double h = (dx != 0 || dy != 0) ? (0.5 * thickness / sqrt(PCB_SQUARE(dx) + PCB_SQUARE(dy))) : 0.0; - pcb_coord_t ox = dy * h + 0.5 * SGN(dy); - pcb_coord_t oy = -(dx * h + 0.5 * SGN(dx)); - - pcb_gui->draw_line(GC, x1 + ox, y1 + oy, x2 + ox, y2 + oy); - - if (coord_abs(ox) >= pcb_pixel_slop || coord_abs(oy) >= pcb_pixel_slop) { - pcb_angle_t angle = atan2(dx, dy) * 57.295779; - pcb_gui->draw_line(GC, x1 - ox, y1 - oy, x2 - ox, y2 - oy); - pcb_gui->draw_arc(GC, x1, y1, thickness / 2, thickness / 2, angle - 180, 180); - pcb_gui->draw_arc(GC, x2, y2, thickness / 2, thickness / 2, angle, 180); - } -} - -/*----------------------------------------------------------- * Draws the outline of an arc *---------------------------------------------------------*/ void @@ -630,7 +603,7 @@ switch(p_obj->type) { case PCB_TYPE_LINE : - pcb_route_draw_line(GC,p_obj->point1.X,p_obj->point1.Y,p_obj->point2.X,p_obj->point2.Y,p_route->thickness); + pcb_draw_wireframe_line(GC,p_obj->point1.X,p_obj->point1.Y,p_obj->point2.X,p_obj->point2.Y,p_route->thickness); break; case PCB_TYPE_ARC : @@ -659,7 +632,7 @@ switch(p_obj->type) { case PCB_TYPE_LINE : - pcb_route_draw_line(GC,p_obj->point1.X,p_obj->point1.Y,p_obj->point2.X,p_obj->point2.Y,thickness); + pcb_draw_wireframe_line(GC,p_obj->point1.X,p_obj->point1.Y,p_obj->point2.X,p_obj->point2.Y,thickness); break; case PCB_TYPE_ARC :