Index: trunk/doc/TODO =================================================================== --- trunk/doc/TODO (revision 34421) +++ trunk/doc/TODO (revision 34422) @@ -5,7 +5,6 @@ - CLEANUP: ui layers: data parent cleanup: bug_files/uilayer.patch: ui layers should have a data parent in pcb_board_t and no global variables in layer_ui.[ch] (ui layers are board-specific) [report: Igor2] - CLEANUP: rewrite ps_calibrate_1 to use DAD dialog and test - FEATURE: (TT) route style upgrade to prototypes - requires lihata v8: - - BUG: {m t +} or setsame() doesn't turn routing style off - ANNOUNCE: setsame works on text - CLEANUP: remove pcb_board_set_via_size and board property for via geometry - CLEANUP: search for TODO pstk #21 for more code removal @@ -14,7 +13,7 @@ - TEST: AdjustStyle() with no arg, GetStyle, route style menu - CLEANUP: RouteStyle() argumens and doc - CLEANUP: make lihata v8 the default version - - CLEANUP: update default board to lihata v8: use via protos + - CLEANUP: update default board to lihata v8: use via protos, set all text fields explicitly - ANNOUNCE: route style font id - ANNOUNCE: setsame works on vias Index: trunk/src/route_style.c =================================================================== --- trunk/src/route_style.c (revision 34421) +++ trunk/src/route_style.c (revision 34422) @@ -119,6 +119,12 @@ return -1; } +int pcb_lookup_route_style_pen_bestfit(pcb_board_t *pcb) +{ + int res = PCB_LOOKUP_ROUTE_STYLE_PEN_STRICT(pcb); + if (res == -1) res = PCB_LOOKUP_ROUTE_STYLE_PEN(pcb); + return res; +} int pcb_get_style_size(int funcid, rnd_coord_t * out, int type, int size_id) { Index: trunk/src/route_style.h =================================================================== --- trunk/src/route_style.h (revision 34421) +++ trunk/src/route_style.h (revision 34422) @@ -52,8 +52,8 @@ size_id: 0=main size; 1=2nd size (drill); 2=clearance */ int pcb_get_style_size(int funcid, rnd_coord_t * out, int type, int size_id); -#define PCB_LOOKUP_ROUTE_STYLE_PEN(pcb) \ - pcb_route_style_lookup(&pcb->RouteStyle,\ +#define PCB_LOOKUP_ROUTE_STYLE_PEN_(pcb, how) \ + pcb_route_style_ ## how(&pcb->RouteStyle,\ conf_core.design.line_thickness, \ conf_core.design.text_thickness, \ conf_core.design.text_scale, \ @@ -64,6 +64,16 @@ conf_core.design.via_proto, \ NULL) +#define PCB_LOOKUP_ROUTE_STYLE_PEN(pcb) \ + PCB_LOOKUP_ROUTE_STYLE_PEN_(pcb, lookup) + +#define PCB_LOOKUP_ROUTE_STYLE_PEN_STRICT(pcb) \ + PCB_LOOKUP_ROUTE_STYLE_PEN_(pcb, lookup_strict) + +/* Tries strict first, if that fails, returns normal lookup */ +int pcb_lookup_route_style_pen_bestfit(pcb_board_t *pcb); + + #define PCB_MATCH_ROUTE_STYLE_PEN(rst) \ pcb_route_style_match(rst,\ conf_core.design.line_thickness, \ @@ -76,6 +86,7 @@ conf_core.design.via_proto, \ NULL) + /*** Undoable changes to route styles ***/ /* Change a field. Returns 0 on success. */ Index: trunk/src_plugins/lib_hid_pcbui/routest.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/routest.c (revision 34421) +++ trunk/src_plugins/lib_hid_pcbui/routest.c (revision 34422) @@ -133,7 +133,7 @@ if (rst.sub_inited) { int n, target; - target = PCB_LOOKUP_ROUTE_STYLE_PEN(PCB); + target = pcb_lookup_route_style_pen_bestfit(PCB); for(n = 0; n < vtroutestyle_len(&PCB->RouteStyle); n++) { rnd_hid_attr_val_t hv;