Index: trunk/src/obj_arc.c =================================================================== --- trunk/src/obj_arc.c (revision 14717) +++ trunk/src/obj_arc.c (revision 14718) @@ -282,13 +282,16 @@ return 1; } -unsigned int pcb_arc_hash(const pcb_element_t *e, const pcb_arc_t *a) +unsigned int pcb_subc_arc_hash(pcb_coord_t ox, pcb_coord_t oy, const pcb_arc_t *a) { + unsigned int crd = 0; + if (!PCB_FLAG_TEST(PCB_FLAG_FLOATER, a)) + crd = pcb_hash_coord(a->X-ox) ^ pcb_hash_coord(a->Y-oy); + return pcb_hash_coord(a->Thickness) ^ pcb_hash_coord(a->Clearance) ^ pcb_hash_coord(a->Width) ^ pcb_hash_coord(a->Height) ^ - pcb_hash_element_ox(e, a->X) ^ pcb_hash_element_oy(e, a->Y) ^ - pcb_hash_coord(a->StartAngle) ^ pcb_hash_coord(a->Delta); + pcb_hash_coord(a->StartAngle) ^ pcb_hash_coord(a->Delta) ^ crd; } pcb_coord_t pcb_arc_length(const pcb_arc_t *arc) Index: trunk/src/obj_arc.h =================================================================== --- trunk/src/obj_arc.h (revision 14717) +++ trunk/src/obj_arc.h (revision 14718) @@ -67,7 +67,7 @@ /*** hash ***/ int pcb_arc_eq(const pcb_element_t *e1, const pcb_arc_t *a1, const pcb_element_t *e2, const pcb_arc_t *a2); -unsigned int pcb_arc_hash(const pcb_element_t *e, const pcb_arc_t *a); +unsigned int pcb_subc_arc_hash(pcb_coord_t ox, pcb_coord_t oy, const pcb_arc_t *a); /* Return the x;y coordinate of the endpoint of an arc; if which is 0, return Index: trunk/src/obj_line.c =================================================================== --- trunk/src/obj_line.c (revision 14717) +++ trunk/src/obj_line.c (revision 14718) @@ -281,13 +281,15 @@ } -unsigned int pcb_line_hash(const pcb_element_t *e, const pcb_line_t *l) +unsigned int pcb_subc_line_hash(pcb_coord_t ox, pcb_coord_t oy, const pcb_line_t *l) { - return - pcb_hash_coord(l->Thickness) ^ pcb_hash_coord(l->Clearance) ^ - pcb_hash_element_ox(e, l->Point1.X) ^ pcb_hash_element_oy(e, l->Point1.Y) ^ - pcb_hash_element_ox(e, l->Point2.X) ^ pcb_hash_element_oy(e, l->Point2.Y) ^ - pcb_hash_str(l->Number); + unsigned int crd = 0; + if (!PCB_FLAG_TEST(PCB_FLAG_FLOATER, l)) + crd = pcb_hash_coord(l->Point1.X-ox) ^ pcb_hash_coord(l->Point1.Y-oy) ^ + pcb_hash_coord(l->Point2.X-ox) ^ pcb_hash_coord(l->Point2.Y-oy); + + return pcb_hash_coord(l->Thickness) ^ pcb_hash_coord(l->Clearance) ^ + pcb_hash_str(l->term) ^ crd; } @@ -295,6 +297,7 @@ { pcb_coord_t dx = line->Point1.X - line->Point2.X; pcb_coord_t dy = line->Point1.Y - line->Point2.Y; +#warning TODO: use the distance func instead return pcb_round(sqrt((double)dx*(double)dx + (double)dy*(double)dy)); } Index: trunk/src/obj_line.h =================================================================== --- trunk/src/obj_line.h (revision 14717) +++ trunk/src/obj_line.h (revision 14718) @@ -75,7 +75,7 @@ /* hash */ int pcb_line_eq(const pcb_element_t *e1, const pcb_line_t *l1, const pcb_element_t *e2, const pcb_line_t *l2); -unsigned int pcb_line_hash(const pcb_element_t *e, const pcb_line_t *l); +unsigned int pcb_subc_line_hash(pcb_coord_t ox, pcb_coord_t oy, const pcb_line_t *l); /*** DRC enforcement (obj_line_drcenf.c) ***/