Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 18027) +++ trunk/src/draw.c (revision 18028) @@ -454,11 +454,16 @@ static void pcb_draw_pstks(pcb_layergrp_id_t group, const pcb_box_t *drawn_area, int is_current, pcb_layer_combining_t comb) { + pcb_layergrp_t *g = PCB->LayerGroups.grp + group; pcb_pstk_draw_t ctx; ctx.pcb = PCB; ctx.gid = group; ctx.is_current = is_current; ctx.comb = comb; + if (g->len > 0) + ctx.layer1 = pcb_get_layer(PCB->Data, g->lid[0]); + else + ctx.layer1 = NULL; pcb_r_search(PCB->Data->padstack_tree, drawn_area, NULL, pcb_pstk_draw_callback, &ctx, NULL); } Index: trunk/src/obj_pstk.c =================================================================== --- trunk/src/obj_pstk.c (revision 18027) +++ trunk/src/obj_pstk.c (revision 18028) @@ -284,13 +284,17 @@ /*** draw ***/ -static void set_ps_color(pcb_pstk_t *ps, int is_current, pcb_layer_type_t lyt) +static void set_ps_color(pcb_pstk_t *ps, int is_current, pcb_layer_type_t lyt, pcb_layer_t *ly1) { char *color, *layer_color = NULL; char buf[sizeof("#XXXXXX")]; - if (lyt & PCB_LYT_PASTE) - layer_color = conf_core.appearance.color.paste; + if ((lyt & PCB_LYT_PASTE) || (lyt & PCB_LYT_MASK) || (lyt & PCB_LYT_SILK)) { + if (ly1 == NULL) + layer_color = pcb_layer_default_color(0, lyt); + else + layer_color = ly1->meta.real.color; + } if (ps->term == NULL) { /* normal via, not a terminal */ @@ -414,9 +418,9 @@ if (shape != NULL) { if (grp == NULL) - set_ps_color(ps, ctx->is_current, ctx->shape_mask); + set_ps_color(ps, ctx->is_current, ctx->shape_mask, ctx->layer1); else - set_ps_color(ps, ctx->is_current, grp->ltype); + set_ps_color(ps, ctx->is_current, grp->ltype, ctx->layer1); if (conf_core.editor.thin_draw || conf_core.editor.wireframe_draw) { pcb_hid_set_line_width(pcb_draw_out.fgGC, 0); pcb_pstk_draw_shape_thin(pcb_draw_out.fgGC, ps, shape); Index: trunk/src/obj_pstk_draw.h =================================================================== --- trunk/src/obj_pstk_draw.h (revision 18027) +++ trunk/src/obj_pstk_draw.h (revision 18028) @@ -47,6 +47,7 @@ int is_current; pcb_pstk_draw_hole_t holetype; pcb_layer_combining_t comb; + pcb_layer_t *layer1; /* first (real) layer in the target group */ pcb_layer_type_t shape_mask; /* when gid is invalid, use this for the shapes */ } pcb_pstk_draw_t;