Index: trunk/src/obj_arc.c =================================================================== --- trunk/src/obj_arc.c (revision 14736) +++ trunk/src/obj_arc.c (revision 14737) @@ -286,9 +286,13 @@ unsigned int pcb_arc_hash(const pcb_host_trans_t *tr, const pcb_arc_t *a) { unsigned int crd = 0; - if (!PCB_FLAG_TEST(PCB_FLAG_FLOATER, a)) - crd = pcb_hash_cx(tr, a->X) ^ pcb_hash_cy(tr, a->Y); + if (!PCB_FLAG_TEST(PCB_FLAG_FLOATER, a)) { + pcb_coord_t x, y; + pcb_hash_tr_coords(tr, &x, &y, a->X, a->Y); + crd = pcb_hash_coord(x) ^ pcb_hash_coord(y); + } + return pcb_hash_coord(a->Thickness) ^ pcb_hash_coord(a->Clearance) ^ pcb_hash_coord(a->Width) ^ pcb_hash_coord(a->Height) ^ Index: trunk/src/obj_hash.h =================================================================== --- trunk/src/obj_hash.h (revision 14736) +++ trunk/src/obj_hash.h (revision 14737) @@ -26,6 +26,7 @@ #include #include +#include "compat_misc.h" /* compare two strings and return 0 if they are equal. NULL == NULL means equal. */ PCB_INLINE int pcb_neqs(const char *s1, const char *s2) @@ -40,18 +41,24 @@ return murmurhash(&(c), sizeof(pcb_coord_t)); } -PCB_INLINE unsigned pcb_hash_cx(const pcb_host_trans_t *tr, pcb_coord_t c) +PCB_INLINE void pcb_hash_tr_coords(const pcb_host_trans_t *tr, pcb_coord_t *dstx, pcb_coord_t *dsty, pcb_coord_t srcx, pcb_coord_t srcy) { - c -= tr->ox; - return murmurhash(&(c), sizeof(pcb_coord_t)); -} + pcb_coord_t px, py; -PCB_INLINE unsigned pcb_hash_cy(const pcb_host_trans_t *tr, pcb_coord_t c) -{ - c -= tr->oy; - return murmurhash(&(c), sizeof(pcb_coord_t)); + px = srcx - tr->ox; + py = srcy - tr->oy; + + if ((tr->rot == 0.0) && (!tr->on_bottom)) { + *dstx = px; + *dsty = py; + } + else { + *dstx = pcb_round((double)px * tr->cosa + (double)py * tr->sina); + *dsty = pcb_round((double)py * tr->cosa - (double)px * tr->sina); + } } + PCB_INLINE unsigned pcb_hash_angle(const pcb_host_trans_t *tr, pcb_angle_t ang) { long l; Index: trunk/src/obj_line.c =================================================================== --- trunk/src/obj_line.c (revision 14736) +++ trunk/src/obj_line.c (revision 14737) @@ -285,10 +285,14 @@ unsigned int pcb_line_hash(const pcb_host_trans_t *tr, const pcb_line_t *l) { unsigned int crd = 0; - if (!PCB_FLAG_TEST(PCB_FLAG_FLOATER, l)) - crd = pcb_hash_cx(tr, l->Point1.X) ^ pcb_hash_cy(tr, l->Point1.Y) ^ - pcb_hash_cx(tr, l->Point2.X) ^ pcb_hash_cy(tr, l->Point2.Y); + if (!PCB_FLAG_TEST(PCB_FLAG_FLOATER, l)) { + pcb_coord_t x1, y1, x2, y2; + pcb_hash_tr_coords(tr, &x1, &y1, l->Point1.X, l->Point1.Y); + pcb_hash_tr_coords(tr, &x2, &y2, l->Point2.X, l->Point2.Y); + crd = pcb_hash_coord(x1) ^ pcb_hash_coord(y1) ^ pcb_hash_coord(x2) ^ pcb_hash_coord(y2); + } + return pcb_hash_coord(l->Thickness) ^ pcb_hash_coord(l->Clearance) ^ pcb_hash_str(l->term) ^ crd; } Index: trunk/src/obj_poly.c =================================================================== --- trunk/src/obj_poly.c (revision 14736) +++ trunk/src/obj_poly.c (revision 14737) @@ -216,9 +216,13 @@ pcb_cardinal_t n; if (!PCB_FLAG_TEST(PCB_FLAG_FLOATER, p)) - for(n = 0; n < p->PointN; n++) - crd ^= pcb_hash_cx(tr, p->Points[n].X) ^ pcb_hash_cy(tr, p->Points[n].Y); + for(n = 0; n < p->PointN; n++) { + pcb_coord_t x, y; + pcb_hash_tr_coords(tr, &x, &y, p->Points[n].X, p->Points[n].Y); + crd ^= pcb_hash_coord(x) ^ pcb_hash_coord(y); + } + return pcb_hash_coord(p->Clearance) ^ pcb_hash_str(p->term) ^ crd; } Index: trunk/src/obj_pstk.c =================================================================== --- trunk/src/obj_pstk.c (revision 14736) +++ trunk/src/obj_pstk.c (revision 14737) @@ -179,9 +179,14 @@ unsigned int pcb_pstk_hash(const pcb_host_trans_t *tr, const pcb_pstk_t *p) { unsigned int crd = 0; - if (!PCB_FLAG_TEST(PCB_FLAG_FLOATER, p)) - crd = pcb_hash_cx(tr, p->x) ^ pcb_hash_cy(tr, p->y); + if (!PCB_FLAG_TEST(PCB_FLAG_FLOATER, p)) { + pcb_coord_t x, y; + + pcb_hash_tr_coords(tr, &x, &y, p->x, p->y); + crd = pcb_hash_coord(x) ^ pcb_hash_coord(y); + } + return pcb_hash_angle(tr, p->rot) ^ pcb_hash_coord(p->Clearance) ^ pcb_hash_str(p->term) ^ crd ^ murmurhash(&p->smirror, sizeof(p->smirror)) ^ Index: trunk/src/obj_text.c =================================================================== --- trunk/src/obj_text.c (revision 14736) +++ trunk/src/obj_text.c (revision 14737) @@ -347,9 +347,14 @@ unsigned int pcb_text_hash(const pcb_host_trans_t *tr, const pcb_text_t *t) { unsigned int crd = 0; - if (!PCB_FLAG_TEST(PCB_FLAG_FLOATER, t)) - crd = pcb_hash_cx(tr, t->X) ^ pcb_hash_cy(tr, t->Y) ^ pcb_hash_coord(t->Scale); + if (!PCB_FLAG_TEST(PCB_FLAG_FLOATER, t)) { + pcb_coord_t x, y; + + pcb_hash_tr_coords(tr, &x, &y, t->X, t->Y); + crd = pcb_hash_coord(x) ^ pcb_hash_coord(y) ^ pcb_hash_coord(t->Scale); + } + return pcb_hash_str(t->TextString) ^ pcb_hash_str(t->term) ^ crd; }