Index: trunk/src/Makefile.dep =================================================================== --- trunk/src/Makefile.dep (revision 4624) +++ trunk/src/Makefile.dep (revision 4625) @@ -2918,7 +2918,7 @@ box.h move.h misc_util.h data.h crosshair.h rubberband.h vtonpoint.h \ hid.h error.h drc.h buffer.h draw.h rotate.h rtree.h stub_draw_fab.h \ obj_all.h obj_pad_draw.h obj_pinvia_draw.h obj_elem_draw.h \ - obj_line_draw.h obj_arc_draw.h + obj_line_draw.h obj_arc_draw.h obj_rat_draw.h error.o: error.c ../config.h data.h globalconst.h global_typedefs.h \ pcb_bool.h unit.h layer.h attrib.h obj_all_list.h obj_arc_list.h \ obj_common.h ../src_3rd/genlist/gendlist.h flag.h obj_arc.h \ @@ -3534,8 +3534,8 @@ ../src_3rd/liblihata/dom.h ../src_3rd/liblihata/lihata.h \ ../src_3rd/liblihata/parser.h ../src_3rd/liblihata/genht/htsp.h \ ../src_3rd/liblihata/genht/ht.h ../src_3rd/genvector/vtp0.h list_conf.h \ - undo.h rtree.h obj_rat_op.h operation.h draw.h rats.h netlist.h \ - route_style.h + undo.h rtree.h obj_line_draw.h obj_rat_op.h operation.h draw.h rats.h \ + netlist.h route_style.h obj_rat_list.o: obj_rat_list.c obj_rat_list.h obj_rat.h obj_common.h \ ../src_3rd/genlist/gendlist.h flag.h globalconst.h ../config.h attrib.h \ global_typedefs.h pcb_bool.h unit.h ../src_3rd/genlist/gentdlist_impl.h \ Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 4624) +++ trunk/src/draw.c (revision 4625) @@ -45,6 +45,7 @@ #include "obj_elem_draw.h" #include "obj_line_draw.h" #include "obj_arc_draw.h" +#include "obj_rat_draw.h" #undef NDEBUG #include @@ -136,36 +137,6 @@ r_search(PCB->Data->via_tree, drawn_area, NULL, draw_hole_callback, &plated, NULL); } -static r_dir_t rat_callback(const BoxType * b, void *cl) -{ - RatType *rat = (RatType *) b; - - if (TEST_FLAG(PCB_FLAG_SELECTED | PCB_FLAG_FOUND, rat)) { - if (TEST_FLAG(PCB_FLAG_SELECTED, rat)) - gui->set_color(Output.fgGC, PCB->RatSelectedColor); - else - gui->set_color(Output.fgGC, PCB->ConnectedColor); - } - else - gui->set_color(Output.fgGC, PCB->RatColor); - - if (conf_core.appearance.rat_thickness < 20) - rat->Thickness = pixel_slop * conf_core.appearance.rat_thickness; - /* rats.c set PCB_FLAG_VIA if this rat goes to a containing poly: draw a donut */ - if (TEST_FLAG(PCB_FLAG_VIA, rat)) { - int w = rat->Thickness; - - if (conf_core.editor.thin_draw) - gui->set_line_width(Output.fgGC, 0); - else - gui->set_line_width(Output.fgGC, w); - gui->draw_arc(Output.fgGC, rat->Point1.X, rat->Point1.Y, w * 2, w * 2, 0, 360); - } - else - _draw_line((LineType *) rat); - return R_DIR_FOUND_CONTINUE; -} - /* --------------------------------------------------------------------------- * prints assembly drawing. */ @@ -499,7 +470,7 @@ if (can_mask) gui->use_mask(HID_MASK_CLEAR); - r_search(PCB->Data->rat_tree, drawn_area, NULL, rat_callback, NULL, NULL); + r_search(PCB->Data->rat_tree, drawn_area, NULL, draw_rat_callback, NULL, NULL); if (can_mask) gui->use_mask(HID_MASK_OFF); } Index: trunk/src/obj_rat.c =================================================================== --- trunk/src/obj_rat.c (revision 4624) +++ trunk/src/obj_rat.c (revision 4625) @@ -34,6 +34,8 @@ #include "undo.h" #include "rtree.h" +#include "obj_line_draw.h" + #include "obj_rat.h" #include "obj_rat_list.h" #include "obj_rat_op.h" @@ -215,3 +217,34 @@ MoveObjectToRemoveUndoList(PCB_TYPE_RATLINE, Rat, Rat, Rat); return NULL; } + +/*** draw ***/ +r_dir_t draw_rat_callback(const BoxType * b, void *cl) +{ + RatType *rat = (RatType *) b; + + if (TEST_FLAG(PCB_FLAG_SELECTED | PCB_FLAG_FOUND, rat)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, rat)) + gui->set_color(Output.fgGC, PCB->RatSelectedColor); + else + gui->set_color(Output.fgGC, PCB->ConnectedColor); + } + else + gui->set_color(Output.fgGC, PCB->RatColor); + + if (conf_core.appearance.rat_thickness < 20) + rat->Thickness = pixel_slop * conf_core.appearance.rat_thickness; + /* rats.c set PCB_FLAG_VIA if this rat goes to a containing poly: draw a donut */ + if (TEST_FLAG(PCB_FLAG_VIA, rat)) { + int w = rat->Thickness; + + if (conf_core.editor.thin_draw) + gui->set_line_width(Output.fgGC, 0); + else + gui->set_line_width(Output.fgGC, w); + gui->draw_arc(Output.fgGC, rat->Point1.X, rat->Point1.Y, w * 2, w * 2, 0, 360); + } + else + _draw_line((LineType *) rat); + return R_DIR_FOUND_CONTINUE; +} Index: trunk/src/obj_rat_draw.h =================================================================== --- trunk/src/obj_rat_draw.h (nonexistent) +++ trunk/src/obj_rat_draw.h (revision 4625) @@ -0,0 +1,28 @@ +/* + * COPYRIGHT + * + * PCB, interactive printed circuit board design + * Copyright (C) 1994,1995,1996 Thomas Nau + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Contact addresses for paper mail and Email: + * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany + * Thomas.Nau@rz.uni-ulm.de + * + */ + +/*** Standard draw on rats ***/ +r_dir_t draw_rat_callback(const BoxType * b, void *cl);