Index: trunk/src/obj_hash.h =================================================================== --- trunk/src/obj_hash.h (revision 14751) +++ trunk/src/obj_hash.h (revision 14752) @@ -89,6 +89,16 @@ /* compare two fields and return 0 if they are equal */ #define pcb_field_neq(s1, s2, f) ((s1)->f != (s2)->f) +/* retruns if two sets of tr;x;y mismatches */ +static inline pcb_bool pcb_neq_tr_coords(const pcb_host_trans_t *tr1, pcb_coord_t x1, pcb_coord_t y1, const pcb_host_trans_t *tr2, pcb_coord_t x2, pcb_coord_t y2) +{ + pcb_hash_tr_coords(tr1, &x1, &y1, x1, y1); + pcb_hash_tr_coords(tr2, &x2, &y2, x2, y2); + if (x1 != x2) return pcb_true; + if (y1 != y2) return pcb_true; + return pcb_false; +} + #define pcb_element_offs(e,ef, s,sf) ((e == NULL) ? (s)->sf : ((s)->sf) - ((e)->ef)) #define pcb_element_neq_offsx(e1, x1, e2, x2, f) (pcb_element_offs(e1, MarkX, x1, f) != pcb_element_offs(e2, MarkX, x2, f)) #define pcb_element_neq_offsy(e1, y1, e2, y2, f) (pcb_element_offs(e1, MarkY, y1, f) != pcb_element_offs(e2, MarkY, y2, f)) Index: trunk/src/obj_line.c =================================================================== --- trunk/src/obj_line.c (revision 14751) +++ trunk/src/obj_line.c (revision 14752) @@ -272,12 +272,12 @@ pcb_set_point_bounding_box(&Line->Point2); } -int pcb_line_eq(const pcb_element_t *e1, const pcb_line_t *l1, const pcb_element_t *e2, const pcb_line_t *l2) +int pcb_line_eq(const pcb_host_trans_t *tr1, const pcb_line_t *l1, const pcb_host_trans_t *tr2, const pcb_line_t *l2) { 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 (pcb_neq_tr_coords(tr1, l1->Point1.X, l1->Point1.Y, tr2, l2->Point1.X, l2->Point1.Y)) return 0; + if (pcb_neq_tr_coords(tr1, l1->Point2.X, l1->Point2.Y, tr2, l2->Point2.X, l2->Point2.Y)) return 0; + if (pcb_neqs(l1->term, l2->term)) return 0; return 1; } Index: trunk/src/obj_line.h =================================================================== --- trunk/src/obj_line.h (revision 14751) +++ trunk/src/obj_line.h (revision 14752) @@ -74,8 +74,8 @@ /* Convert a square cap line (e.g. a gEDA/pcb pad) to 4 corner points of a rectangle */ void pcb_sqline_to_rect(const pcb_line_t *line, pcb_coord_t *x, pcb_coord_t *y); -/* 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); +/* hash and eq */ +int pcb_line_eq(const pcb_host_trans_t *tr1, const pcb_line_t *l1, const pcb_host_trans_t *tr2, const pcb_line_t *l2); unsigned int pcb_line_hash(const pcb_host_trans_t *tr, const pcb_line_t *l);