1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-12-22 22:52:25 +02:00

Drawing all the pad layers as filled areas can cause confusion. Now we draw

the solder mask with lines.

- gui_inst.c: draw solder mask with lines, not with filled rectangles and arcs
- gui_style.c: increase line width for solder mask from 1 to 2 pixels
- Makefile: added manual/concept-inst.png (forgot to commit this before)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5696 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
werner 2009-10-19 15:00:30 +00:00
parent c172870dfd
commit cd830046fa
4 changed files with 29 additions and 24 deletions

View File

@ -28,7 +28,8 @@ XPMS = point.xpm delete.xpm delete_off.xpm \
stuff.xpm stuff_off.xpm meas_off.xpm \
bright.xpm bright_off.xpm all.xpm all_off.xpm
PNGS = intro-1.png intro-2.png intro-3.png intro-4.png intro-5.png intro-6.png
PNGS = intro-1.png intro-2.png intro-3.png intro-4.png intro-5.png \
intro-6.png concept-inst.png
SHELL = /bin/bash
CFLAGS_GTK = `pkg-config --cflags gtk+-2.0`

View File

@ -257,12 +257,14 @@ static void gui_draw_pad_text(struct inst *self)
}
static GdkGC *pad_gc(const struct inst *inst)
static GdkGC *pad_gc(const struct inst *inst, int *fill)
{
*fill = TRUE;
switch (layers_to_pad_type(inst->u.pad.layers)) {
case pt_bare:
return gc_pad_bare[get_mode(inst)];
case pt_mask:
*fill = FALSE;
return gc_pad_mask[get_mode(inst)];
default:
return gc_pad[get_mode(inst)];
@ -275,10 +277,11 @@ void gui_draw_pad(struct inst *self)
struct coord min = translate(self->base);
struct coord max = translate(self->u.pad.other);
GdkGC *gc;
int fill;
gc = pad_gc(self);
gc = pad_gc(self, &fill);
sort_coord(&min, &max);
gdk_draw_rectangle(DA, gc, TRUE,
gdk_draw_rectangle(DA, gc, fill,
min.x, min.y, max.x-min.x, max.y-min.y);
gui_draw_pad_text(self);
@ -290,22 +293,23 @@ void gui_draw_rpad(struct inst *self)
struct coord min = translate(self->base);
struct coord max = translate(self->u.pad.other);
GdkGC *gc;
int fill;
unit_type h, w, r;
gc = pad_gc(self);
gc = pad_gc(self, &fill);
sort_coord(&min, &max);
h = max.y-min.y;
w = max.x-min.x;
if (h > w) {
r = w/2;
draw_arc(DA, gc, TRUE, min.x+r, max.y-r, r, 180, 0);
gdk_draw_rectangle(DA, gc, TRUE, min.x, min.y+r, w, h-2*r);
draw_arc(DA, gc, TRUE, min.x+r, min.y+r, r, 0, 180);
draw_arc(DA, gc, fill, min.x+r, max.y-r, r, 180, 0);
gdk_draw_rectangle(DA, gc, fill, min.x, min.y+r, w, h-2*r);
draw_arc(DA, gc, fill, min.x+r, min.y+r, r, 0, 180);
} else {
r = h/2;
draw_arc(DA, gc, TRUE, min.x+r, min.y+r, r, 90, 270);
gdk_draw_rectangle(DA, gc, TRUE, min.x+r, min.y, w-2*r, h);
draw_arc(DA, gc, TRUE, max.x-r, min.y+r, r, 270, 90);
draw_arc(DA, gc, fill, min.x+r, min.y+r, r, 90, 270);
gdk_draw_rectangle(DA, gc, fill, min.x+r, min.y, w-2*r, h);
draw_arc(DA, gc, fill, max.x-r, min.y+r, r, 270, 90);
}
gui_draw_pad_text(self);

View File

@ -48,11 +48,11 @@ static GdkGC *gc(const char *spec, int width)
static void style(GdkGC *gcs[mode_n],
const char *in, const char *act, const char *sel)
const char *in, const char *act, const char *sel, int width)
{
gcs[mode_inactive] = gc(in, 1);
gcs[mode_active] = gc(act, 1);
gcs[mode_selected] = gc(sel, 2);
gcs[mode_inactive] = gc(in, width);
gcs[mode_active] = gc(act, width);
gcs[mode_selected] = gc(sel, 2*width);
}
@ -62,14 +62,14 @@ void gui_setup_style(GdkDrawable *drawable)
gc_bg_error = gc("#000040", 0);
gc_drag = gc("#ffffff", 2);
/* inactive active selected */
style(gc_vec, "#202000", "#b0b050", "#ffff80");
style(gc_obj, "#006060", "#00ffff", "#ffff80");
style(gc_pad, "#400000", "#ff0000", "#ffff80");
style(gc_pad_bare, "#402000", "#ff6000", "#ffff80");
style(gc_pad_mask, "#000040", "#0000ff", "#ffff80");
style(gc_ptext, "#404040", "#ffffff", "#ffffff");
style(gc_meas, "#280040", "#ff00ff", "#ffff80");
style(gc_frame, "#005000", "#009000", "#ffff80");
style(gc_vec, "#202000", "#b0b050", "#ffff80", 1);
style(gc_obj, "#006060", "#00ffff", "#ffff80", 1);
style(gc_pad, "#400000", "#ff0000", "#ffff80", 1);
style(gc_pad_bare, "#402000", "#ff6000", "#ffff80", 1);
style(gc_pad_mask, "#000040", "#0000ff", "#ffff80", 2);
style(gc_ptext, "#404040", "#ffffff", "#ffffff", 1);
style(gc_meas, "#280040", "#ff00ff", "#ffff80", 1);
style(gc_frame, "#005000", "#009000", "#ffff80", 1);
gc_active_frame = gc("#00ff00", 2);
// gc_highlight = gc("#ff8020", 2);

2
inst.h
View File

@ -41,7 +41,7 @@ enum inst_prio {
ip_pad_copper, /* pads also accept clicks inside; pads with copper */
ip_pad_special, /* pads with only solder paste or mask, on top */
ip_circ, /* circles don't overlap easily */
ip_arc, /* arc are like circles, just shorter */
ip_arc, /* arcs are like circles, just shorter */
ip_rect, /* rectangles have plenty of sides */
ip_meas, /* mesurements are like lines but set a bit apart */
ip_line, /* lines are easly overlapped by other things */