Index: trunk/src/obj_poly.c =================================================================== --- trunk/src/obj_poly.c (revision 14755) +++ trunk/src/obj_poly.c (revision 14756) @@ -199,16 +199,23 @@ PCB_END_LOOP; } -#if 0 -int pcb_poly_eq(const pcb_element_t *e1, const pcb_line_t *l1, const pcb_element_t *e2, const pcb_line_t *l2) +int pcb_poly_eq(const pcb_host_trans_t *tr1, const pcb_poly_t *p1, const pcb_host_trans_t *tr2, const pcb_poly_t *p2) { - if (pcb_field_neq(l1, l2, Thickness) || pcb_field_neq(l1, l2, Clearance)) return 0; - if (pcb_element_neq_offsx(e1, l1, e2, l2, Point1.X) || pcb_element_neq_offsy(e1, l1, e2, l2, Point1.Y)) return 0; - if (pcb_element_neq_offsx(e1, l1, e2, l2, Point2.X) || pcb_element_neq_offsy(e1, l1, e2, l2, Point2.Y)) return 0; - if (pcb_neqs(l1->Number, l2->Number)) return 0; + if (p1->PointN != p2->PointN) return 0; + if (pcb_field_neq(p1, p2, Clearance)) return 0; + if (pcb_neqs(p1->term, p2->term)) return 0; + + if (!PCB_FLAG_TEST(PCB_FLAG_FLOATER, p1) && !PCB_FLAG_TEST(PCB_FLAG_FLOATER, p2)) { + pcb_cardinal_t n; + for(n = 0; n < p1->PointN; n++) { + pcb_coord_t x1, y1, x2, y2; + pcb_hash_tr_coords(tr1, &x1, &y1, p1->Points[n].X, p1->Points[n].Y); + pcb_hash_tr_coords(tr2, &x2, &y2, p2->Points[n].X, p2->Points[n].Y); + if ((x1 != x2) || (y1 != y2)) return 0; + } + } return 1; } -#endif unsigned int pcb_poly_hash(const pcb_host_trans_t *tr, const pcb_poly_t *p) { Index: trunk/src/obj_poly.h =================================================================== --- trunk/src/obj_poly.h (revision 14755) +++ trunk/src/obj_poly.h (revision 14756) @@ -77,7 +77,8 @@ void pcb_poly_move(pcb_poly_t *Polygon, pcb_coord_t DX, pcb_coord_t DY); pcb_poly_t *pcb_poly_copy(pcb_poly_t *Dest, pcb_poly_t *Src, pcb_coord_t dx, pcb_coord_t dy); -/* hash */ +/* hash and eq */ +int pcb_poly_eq(const pcb_host_trans_t *tr1, const pcb_poly_t *p1, const pcb_host_trans_t *tr2, const pcb_poly_t *p2); unsigned int pcb_poly_hash(const pcb_host_trans_t *tr, const pcb_poly_t *p); /* Add objects without creating them or making any "sanity modifications" to them */