Index: trunk/doc/conf/tree/editor.html =================================================================== --- trunk/doc/conf/tree/editor.html (revision 14061) +++ trunk/doc/conf/tree/editor.html (revision 14062) @@ -45,6 +45,7 @@ name_on_pcb boolean 0 display Reference Designator as element name, instead of value fullscreen boolean 0 hide widgets to make more room for the drawing move_linepoint_uses_route boolean 0 Moving a line point calculates a new line route. This allows 45/90 line modes when editing lines. + auto_via boolean 0 when drawing traces and switching layers or when moving an object from one layer to another, try to keep connections by automatically inserting vias. route_radius real 0 temporary: route draw helper's arc radius at corners (factor of the trace thickness) click_time integer 0 default time for click expiration, in ms enable_stroke boolean 0 Enable libstroke gestures on middle mouse button when non-zero Index: trunk/src_plugins/rubberband_orig/rubberband.c =================================================================== --- trunk/src_plugins/rubberband_orig/rubberband.c (revision 14061) +++ trunk/src_plugins/rubberband_orig/rubberband.c (revision 14062) @@ -647,36 +647,46 @@ */ static void CheckArcForRubberbandConnection(rubber_ctx_t *rbnd, pcb_layer_t *Layer, pcb_arc_t *Arc, pcb_bool Exact) { - pcb_layergrp_id_t group; struct rubber_info info; int which; pcb_coord_t t = Arc->Thickness / 2, ex, ey; + const pcb_layergrp_id_t group = pcb_layer_get_group_(Layer); + pcb_board_t * board = pcb_data_get_top(PCB->Data); - for(which=0; which<=1; ++which) { - pcb_arc_get_end(Arc,which,&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 = which; + if(group >= 0) { + pcb_cardinal_t length = board->LayerGroups.grp[group].len; + pcb_cardinal_t entry; + const int comb = Layer->comb & PCB_LYC_SUB; - group = pcb_layer_get_group_(Layer); - 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); + for(which=0; which<=1; ++which) { + pcb_arc_get_end(Arc,which,&ex, &ey); + + /* 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 = which; + + 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)) { + /* check all visible lines of the group member */ + info.layer = layer; + pcb_r_search(layer->line_tree, &info.box, NULL, rubber_callback, &info, NULL); + } } } - PCB_END_LOOP; } } @@ -1012,8 +1022,7 @@ break; case PCB_TYPE_ARC: - if (pcb_layer_flags_((pcb_layer_t *)Ptr1) & PCB_LYT_COPPER) - CheckArcForRubberbandConnection(rbnd, (pcb_layer_t *) Ptr1, (pcb_arc_t *) Ptr2, pcb_true); + CheckArcForRubberbandConnection(rbnd, (pcb_layer_t *) Ptr1, (pcb_arc_t *) Ptr2, pcb_true); break; case PCB_TYPE_VIA: