Index: trunk/src/obj_arc.h =================================================================== --- trunk/src/obj_arc.h (revision 6125) +++ trunk/src/obj_arc.h (revision 6126) @@ -103,16 +103,17 @@ #define PCB_ARC_COPPER_LOOP(top) do { \ pcb_cardinal_t l; \ pcb_layer_t *layer = (top)->Layer; \ - for (l =0; l < pcb_max_copper_layer; l++, layer++) \ + for (l =0; l < pcb_max_layer; l++, layer++) \ { \ + if (!(pcb_layer_flags(l) & PCB_LYT_COPPER)) continue; \ PCB_ARC_LOOP(layer) #define PCB_ARC_SILK_LOOP(top) do { \ pcb_cardinal_t l; \ pcb_layer_t *layer = (top)->Layer; \ - layer += pcb_max_copper_layer; \ - for (l = 0; l < 2; l++, layer++) \ + for (l = 0; l < pcb_max_layer; l++, layer++) \ { \ + if (!(pcb_layer_flags(l) & PCB_LYT_SILK)) continue; \ PCB_ARC_LOOP(layer) #define PCB_ARC_VISIBLE_LOOP(top) do { \ Index: trunk/src/obj_line.h =================================================================== --- trunk/src/obj_line.h (revision 6125) +++ trunk/src/obj_line.h (revision 6126) @@ -106,16 +106,17 @@ #define PCB_LINE_COPPER_LOOP(top) do { \ pcb_cardinal_t l; \ pcb_layer_t *layer = (top)->Layer; \ - for (l = 0; l < pcb_max_copper_layer; l++, layer++) \ + for (l = 0; l < pcb_max_layer; l++, layer++) \ { \ + if (!(pcb_layer_flags(l) & PCB_LYT_COPPER)) continue; \ PCB_LINE_LOOP(layer) #define PCB_LINE_SILK_LOOP(top) do { \ pcb_cardinal_t l; \ pcb_layer_t *layer = (top)->Layer; \ - layer += pcb_max_copper_layer; \ - for (l = 0; l < 2; l++, layer++) \ + for (l = 0; l < pcb_max_layer; l++, layer++) \ { \ + if (!(pcb_layer_flags(l) & PCB_LYT_SILK)) continue; \ PCB_LINE_LOOP(layer) #define PCB_LINE_VISIBLE_LOOP(top) do { \ Index: trunk/src/obj_poly.h =================================================================== --- trunk/src/obj_poly.h (revision 6125) +++ trunk/src/obj_poly.h (revision 6126) @@ -96,16 +96,17 @@ #define PCB_POLY_COPPER_LOOP(top) do { \ pcb_cardinal_t l; \ pcb_layer_t *layer = (top)->Layer; \ - for (l = 0; l < pcb_max_copper_layer; l++, layer++) \ + for (l = 0; l < pcb_max_layer; l++, layer++) \ { \ + if (!(pcb_layer_flags(l) & PCB_LYT_COPPER)) continue; \ PCB_POLY_LOOP(layer) #define PCB_POLY_SILK_LOOP(top) do { \ pcb_cardinal_t l; \ pcb_layer_t *layer = (top)->Layer; \ - layer += pcb_max_copper_layer; \ - for (l = 0; l < 2; l++, layer++) \ + for (l = 0; l < pcb_max_layer; l++, layer++) \ { \ + if (!(pcb_layer_flags(l) & PCB_LYT_SILK)) continue; \ PCB_POLY_LOOP(layer) #define PCB_POLY_VISIBLE_LOOP(top) do { \