Index: trunk/src/layer.c =================================================================== --- trunk/src/layer.c (revision 14743) +++ trunk/src/layer.c (revision 14744) @@ -724,20 +724,30 @@ return lay; } -unsigned int pcb_layer_hash_bound(pcb_layer_t *ly) +unsigned int pcb_layer_hash_bound(pcb_layer_t *ly, pcb_bool smirror) { unsigned int hash; + pcb_layer_type_t lyt; + int offs; assert(ly->is_bound); + lyt = ly->meta.bound.type; + offs = ly->meta.bound.stack_offs; + + if (smirror) { + lyt = pcb_layer_mirror_type(lyt); + offs = -offs; + } + hash = (unsigned long)arclist_length(&ly->Arc); hash ^= (unsigned long)linelist_length(&ly->Line); hash ^= (unsigned long)textlist_length(&ly->Text); hash ^= (unsigned long)polylist_length(&ly->Polygon); - hash ^= (unsigned long)ly->comb ^ (unsigned long)ly->meta.bound.type; + hash ^= (unsigned long)ly->comb ^ (unsigned long)lyt; if (ly->meta.bound.type & PCB_LYT_INTERN) - hash ^= ly->meta.bound.stack_offs; + hash ^= (unsigned int)offs; return hash; } Index: trunk/src/layer.h =================================================================== --- trunk/src/layer.h (revision 14743) +++ trunk/src/layer.h (revision 14744) @@ -264,7 +264,7 @@ pcb_layer_t *pcb_layer_new_bound(pcb_data_t *data, pcb_layer_type_t type, const char *name); /* Calculate a hash of a bound layer (ingoring its name) */ -unsigned int pcb_layer_hash_bound(pcb_layer_t *ly); +unsigned int pcb_layer_hash_bound(pcb_layer_t *ly, pcb_bool smirror); /* Calculate mirrored version of some (bound) layer properties */ pcb_layer_type_t pcb_layer_mirror_type(pcb_layer_type_t lyt); Index: trunk/src/obj_subc_hash.c =================================================================== --- trunk/src/obj_subc_hash.c (revision 14743) +++ trunk/src/obj_subc_hash.c (revision 14744) @@ -59,7 +59,7 @@ pcb_text_t *t; pcb_poly_t *p; - hash ^= pcb_layer_hash_bound(ly); + hash ^= pcb_layer_hash_bound(ly, tr.on_bottom); linelist_foreach(&ly->Arc, &it, a) hash ^= pcb_arc_hash(&tr, a);