Index: trunk/src_plugins/rubberband_orig/rubberband.c =================================================================== --- trunk/src_plugins/rubberband_orig/rubberband.c (revision 14062) +++ trunk/src_plugins/rubberband_orig/rubberband.c (revision 14063) @@ -697,53 +697,65 @@ */ static void CheckEntireArcForRubberbandConnection(rubber_ctx_t *rbnd, pcb_layer_t * Layer, pcb_arc_t * Arc) { + pcb_board_t * board = pcb_data_get_top(PCB->Data); + + if(board == NULL) + board = PCB; + /* lookup layergroup and check all visible lines in this group */ pcb_layergrp_id_t group = pcb_layer_get_group_(Layer); - PCB_COPPER_GROUP_LOOP(PCB->Data, group); - { - if (layer->meta.real.vis) { - pcb_coord_t thick; + if(group >= 0) { + pcb_cardinal_t length = board->LayerGroups.grp[group].len; + pcb_cardinal_t entry; + const int comb = Layer->comb & PCB_LYC_SUB; - /* the following code just stupidly compares the endpoints of the lines */ - PCB_LINE_LOOP(layer); - { - pcb_rubberband_t *have_line = NULL; - pcb_bool touches1 = pcb_false; - pcb_bool touches2 = pcb_false; - int l; + 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 (PCB_FLAG_TEST(PCB_FLAG_LOCK, line)) - continue; + if(layer->meta.real.vis && ((layer->comb & PCB_LYC_SUB) == comb)) { + pcb_coord_t thick; - /* Check whether the line is already in the rubberband list. */ - for(l = 0; (l < rbnd->RubberbandN) && (have_line == NULL); l++) - if (rbnd->Rubberband[l].Line == line) - have_line = &rbnd->Rubberband[l]; + /* the following code just stupidly compares the endpoints of the lines */ + PCB_LINE_LOOP(layer); + { + pcb_rubberband_t *have_line = NULL; + pcb_bool touches1 = pcb_false; + pcb_bool touches2 = pcb_false; + int l; - /* Check whether any of the scanned line points touch the passed line */ - thick = (line->Thickness + 1) / 2; - touches1 = pcb_is_point_on_arc(line->Point1.X, line->Point1.Y, thick, Arc); - touches2 = pcb_is_point_on_arc(line->Point2.X, line->Point2.Y, thick, Arc); + if (PCB_FLAG_TEST(PCB_FLAG_LOCK, line)) + continue; - if(touches1) { - if(have_line) - have_line->delta_index[0] = 0; - else - have_line = pcb_rubber_band_create(rbnd, layer, line, 0,0); - } + /* Check whether the line is already in the rubberband list. */ + for(l = 0; (l < rbnd->RubberbandN) && (have_line == NULL); l++) + if (rbnd->Rubberband[l].Line == line) + have_line = &rbnd->Rubberband[l]; - if(touches2) { - if(have_line) - have_line->delta_index[1] = 0; - else - have_line = pcb_rubber_band_create(rbnd, layer, line, 1,0); + /* Check whether any of the scanned line points touch the passed line */ + thick = (line->Thickness + 1) / 2; + touches1 = pcb_is_point_on_arc(line->Point1.X, line->Point1.Y, thick, Arc); + touches2 = pcb_is_point_on_arc(line->Point2.X, line->Point2.Y, thick, Arc); + + if(touches1) { + if(have_line) + have_line->delta_index[0] = 0; + else + have_line = pcb_rubber_band_create(rbnd, layer, line, 0,0); + } + + if(touches2) { + if(have_line) + have_line->delta_index[1] = 0; + else + have_line = pcb_rubber_band_create(rbnd, layer, line, 1,0); + } } + PCB_END_LOOP; } - PCB_END_LOOP; } } - PCB_END_LOOP; } /* --------------------------------------------------------------------------- @@ -971,7 +983,7 @@ { case PCB_OBJ_LINE : if(p_obj->term) CheckLineForRubberbandConnection(rbnd, layer, (pcb_line_t *) p_obj); break; case PCB_OBJ_POLY : if(p_obj->term) CheckPolygonForRubberbandConnection(rbnd, layer, (pcb_poly_t *) p_obj); break; - case PCB_OBJ_ARC : if(p_obj->term) CheckEntireArcForRubberbandConnection(rbnd, layer, (pcb_arc_t *) p_obj); break; + case PCB_OBJ_ARC : /*if(p_obj->term)*/ CheckEntireArcForRubberbandConnection(rbnd, layer, (pcb_arc_t *) p_obj); break; case PCB_OBJ_PSTK : CheckPadStackForRubberbandConnection(rbnd, (pcb_pstk_t *) p_obj); break; default : break; }