1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-23 05:44:04 +02:00

sch2fig/: fix pin name offsets

This commit is contained in:
Werner Almesberger 2016-07-23 23:20:53 -03:00
parent 97f8969716
commit 9f8a09b2d5

View File

@ -131,22 +131,22 @@ static void draw_pin(const struct comp *comp, const struct pin_obj *pin,
switch (pin->orient) {
case 'U':
dy = pin->length;
dy = 1;
rot = 90;
hor = text_min;
break;
case 'D':
dy = -pin->length;
dy = -1;
rot = 90;
hor = text_max;
break;
case 'R':
dx = pin->length;
dx = 1;
rot = 0;
hor = text_min;
break;
case 'L':
dx = -pin->length;
dx = -1;
rot = 0;
hor = text_max;
break;
@ -155,14 +155,17 @@ static void draw_pin(const struct comp *comp, const struct pin_obj *pin,
}
x[0] = mx(pin->x, pin->y, m);
y[0] = my(pin->x, pin->y, m);
x[1] = mx(pin->x + dx, pin->y + dy, m);
y[1] = my(pin->x + dx, pin->y + dy, m);
x[1] = mx(pin->x + dx * pin->length, pin->y + dy * pin->length, m);
y[1] = my(pin->x + dx * pin->length, pin->y + dy * pin->length, m);
fig_poly(2, x, y, COLOR_COMP_DWG, LAYER_COMP_DWG);
dx *= pin->length + comp->name_offset;
dy *= pin->length + comp->name_offset;
struct text txt = {
.s = pin->name,
.x = mx(pin->x + dx + comp->name_offset, pin->y + dy, m),
.y = my(pin->x + dx + comp->name_offset, pin->y + dy, m),
.x = mx(pin->x + dx, pin->y + dy, m),
.y = my(pin->x + dx, pin->y + dy, m),
.size = pin->name_size,
.rot = rot,
.hor = hor,
@ -186,6 +189,7 @@ static void draw_text(const struct text_obj *text, int m[6])
.hor = text_mid,
.vert = text_mid,
};
text_fig(&txt, COLOR_COMP_DWG, WIDTH_COMP_DWG);
}