1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-23 08:57:10 +02:00

sch2fig/fig.c (fig_label): support direction 3 (down)

This commit is contained in:
Werner Almesberger 2016-07-25 01:57:47 -03:00
parent a0c4aedd32
commit fe15498ef1

View File

@ -88,24 +88,30 @@ void fig_label(int x, int y, const char *s, int dir, int dim,
.hor = 0, .hor = 0,
.vert = text_min, .vert = text_min,
}; };
int dy; int dx, dy;
switch (dir) { switch (dir) {
case 0: case 0: /* right */
txt.rot = 0; txt.rot = 0;
txt.hor = text_min; txt.hor = text_min;
dy = 1; dy = 1;
break; break;
case 2: case 2: /* left */
txt.rot = 0; txt.rot = 0;
txt.hor = text_max; txt.hor = text_max;
dy = 1; dy = 1;
break; break;
case 3: /* down */
txt.rot = 90;
txt.hor = text_max;
dx = -1;
break;
default: default:
assert(0); assert(0);
} }
txt.y -= dy * LABEL_OFFSET; txt.y -= dy * LABEL_OFFSET;
txt.x += dx * LABEL_OFFSET;
text_fig(&txt, COLOR_LABEL, LAYER_LABEL); text_fig(&txt, COLOR_LABEL, LAYER_LABEL);
} }