Index: obj_hash.h =================================================================== --- obj_hash.h (revision 14736) +++ 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;