Index: trunk/src_plugins/rubberband_orig/rubberband.c =================================================================== --- trunk/src_plugins/rubberband_orig/rubberband.c (revision 14064) +++ trunk/src_plugins/rubberband_orig/rubberband.c (revision 14065) @@ -607,36 +607,45 @@ */ static void CheckArcPointForRubberbandConnection(rubber_ctx_t *rbnd, pcb_layer_t *Layer, pcb_arc_t *Arc, int *end_pt, pcb_bool Exact) { - pcb_layergrp_id_t group = pcb_layer_get_group_(Layer); - struct rubber_info info; - pcb_coord_t t = Arc->Thickness / 2, ex, ey; - int end; /* = end_pt == pcb_arc_start_ptr ? 0 : 1;*/ + const pcb_layergrp_id_t group = pcb_layer_get_group_(Layer); + pcb_board_t * board = pcb_data_get_top(PCB->Data); - for(end=0;end<=1;++end) - { - pcb_arc_get_end(Arc, end, &ex, &ey); + if(board == NULL) + board = PCB; - /* lookup layergroup and check all visible lines in this group */ - info.radius = Exact ? -1 : MAX(Arc->Thickness / 2, 1); - info.box.X1 = ex - t; - info.box.X2 = ex + t; - info.box.Y1 = ey - t; - info.box.Y2 = ey + t; - info.line = NULL; /* used only to make sure the current object is not added - we are adding lines only and the current object is an arc */ - info.rbnd = rbnd; - info.X = ex; - info.Y = ey; - info.delta_index = end; + if(group >= 0) { + pcb_cardinal_t length = board->LayerGroups.grp[group].len; + pcb_cardinal_t entry; + const pcb_coord_t t = Arc->Thickness / 2; + const int comb = Layer->comb & PCB_LYC_SUB; + struct rubber_info info; + int end; /* = end_pt == pcb_arc_start_ptr ? 0 : 1;*/ + + for(end=0;end<=1;++end) { + pcb_coord_t ex, ey; + pcb_arc_get_end(Arc, end, &ex, &ey); - PCB_COPPER_GROUP_LOOP(PCB->Data, group); - { - /* check all visible lines of the group member */ - if (layer->meta.real.vis) { - info.layer = layer; - pcb_r_search(layer->line_tree, &info.box, NULL, rubber_callback, &info, NULL); + info.radius = Exact ? -1 : MAX(Arc->Thickness / 2, 1); + info.box.X1 = ex - t; + info.box.X2 = ex + t; + info.box.Y1 = ey - t; + info.box.Y2 = ey + t; + info.line = NULL; /* used only to make sure the current object is not added - we are adding lines only and the current object is an arc */ + info.rbnd = rbnd; + info.X = ex; + info.Y = ey; + info.delta_index = end; + + for(entry = 0;entry < length;++entry) { + const pcb_layer_id_t layer_id = board->LayerGroups.grp[group].lid[entry]; + pcb_layer_t * layer = &PCB->Data->Layer[layer_id]; + + if(layer->meta.real.vis && ((layer->comb & PCB_LYC_SUB) == comb)) { + info.layer = layer; + pcb_r_search(layer->line_tree, &info.box, NULL, rubber_callback, &info, NULL); + } } } - PCB_END_LOOP; } } @@ -1039,8 +1048,7 @@ break; case PCB_TYPE_ARC_POINT: - if (pcb_layer_flags_((pcb_layer_t *)Ptr1) & PCB_LYT_COPPER) - CheckArcPointForRubberbandConnection(rbnd, (pcb_layer_t *) Ptr1, (pcb_arc_t *) Ptr2, (int *) Ptr3, pcb_true); + CheckArcPointForRubberbandConnection(rbnd, (pcb_layer_t *) Ptr1, (pcb_arc_t *) Ptr2, (int *) Ptr3, pcb_true); break; case PCB_TYPE_ARC: