mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2025-01-11 12:30:14 +02:00
sch2fig/lib.c (draw_pin_name, draw_pin_num), TODO: support "outside" pin names
There's still a rotation bug affecting this, but this existed before.
This commit is contained in:
parent
4c3a3a1f84
commit
a36ec41dc6
@ -6,8 +6,6 @@
|
|||||||
- support line thickness ?
|
- support line thickness ?
|
||||||
- ~ as space (grep for ~ in out.fig)
|
- ~ as space (grep for ~ in out.fig)
|
||||||
- ~ as overline (grep for ~ in out.fig)
|
- ~ as overline (grep for ~ in out.fig)
|
||||||
- support pin name not inside component
|
|
||||||
- check if pin name/number placement changes if one is disabled
|
|
||||||
- glabel: build for "right" style, then rotate poly
|
- glabel: build for "right" style, then rotate poly
|
||||||
- break into file reading, internal storage, rendering
|
- break into file reading, internal storage, rendering
|
||||||
- show open pins / wires
|
- show open pins / wires
|
||||||
|
@ -201,19 +201,31 @@ static void draw_arc(const struct arc_obj *arc, int m[6])
|
|||||||
static void draw_pin_name(const struct comp *comp, const struct pin_obj *pin,
|
static void draw_pin_name(const struct comp *comp, const struct pin_obj *pin,
|
||||||
int m[6], int dx, int dy, int rot, enum text_align hor)
|
int m[6], int dx, int dy, int rot, enum text_align hor)
|
||||||
{
|
{
|
||||||
int ox, oy;
|
int ox, oy, sx, sy;
|
||||||
|
|
||||||
|
if (comp->name_offset) {
|
||||||
ox = dx * (pin->length + comp->name_offset);
|
ox = dx * (pin->length + comp->name_offset);
|
||||||
oy = dy * (pin->length + comp->name_offset);
|
oy = dy * (pin->length + comp->name_offset);
|
||||||
|
sx = sy = 0;
|
||||||
|
} else {
|
||||||
|
ox = dx * pin->length / 2;
|
||||||
|
oy = dy * pin->length / 2;
|
||||||
|
sx = mxr(-dy * PIN_NUM_OFFSET, dx * PIN_NUM_OFFSET, m);
|
||||||
|
sy = myr(-dy * PIN_NUM_OFFSET, dx * PIN_NUM_OFFSET, m);
|
||||||
|
if (sx > 0)
|
||||||
|
sx = -sx;
|
||||||
|
if (sy > 0)
|
||||||
|
sy = -sy;
|
||||||
|
}
|
||||||
|
|
||||||
struct text txt = {
|
struct text txt = {
|
||||||
.s = pin->name,
|
.s = pin->name,
|
||||||
.x = mx(pin->x + ox, pin->y + oy, m),
|
.x = mx(pin->x + ox, pin->y + oy, m) + sx,
|
||||||
.y = my(pin->x + ox, pin->y + oy, m),
|
.y = my(pin->x + ox, pin->y + oy, m) + sy,
|
||||||
.size = pin->name_size,
|
.size = pin->name_size,
|
||||||
.rot = rot,
|
.rot = rot,
|
||||||
.hor = hor,
|
.hor = comp->name_offset ? hor : text_mid,
|
||||||
.vert = text_mid,
|
.vert = comp->name_offset ? text_mid : text_min,
|
||||||
};
|
};
|
||||||
|
|
||||||
text_rot(&txt, matrix_to_angle(m));
|
text_rot(&txt, matrix_to_angle(m));
|
||||||
@ -251,6 +263,11 @@ static void draw_pin_num(const struct comp *comp, const struct pin_obj *pin,
|
|||||||
if (sy > 0)
|
if (sy > 0)
|
||||||
sy = -sy;
|
sy = -sy;
|
||||||
|
|
||||||
|
if (!comp->name_offset) {
|
||||||
|
sx = -sx;
|
||||||
|
sy = -sy;
|
||||||
|
}
|
||||||
|
|
||||||
struct text txt = {
|
struct text txt = {
|
||||||
.s = pin->number,
|
.s = pin->number,
|
||||||
.x = mx(pin->x + ox, pin->y + oy, m) + sx,
|
.x = mx(pin->x + ox, pin->y + oy, m) + sx,
|
||||||
@ -258,7 +275,7 @@ static void draw_pin_num(const struct comp *comp, const struct pin_obj *pin,
|
|||||||
.size = pin->number_size,
|
.size = pin->number_size,
|
||||||
.rot = rot,
|
.rot = rot,
|
||||||
.hor = text_mid,
|
.hor = text_mid,
|
||||||
.vert = text_min,
|
.vert = comp->name_offset ? text_min : text_max,
|
||||||
};
|
};
|
||||||
|
|
||||||
text_rot(&txt, matrix_to_angle(m) % 180);
|
text_rot(&txt, matrix_to_angle(m) % 180);
|
||||||
|
Loading…
Reference in New Issue
Block a user