1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-27 01:53:44 +02:00

sch2fig/sch.c (draw_text): convert to use text_*; support direction 1 (up)

This commit is contained in:
Werner Almesberger 2016-07-25 15:19:53 -03:00
parent 3433068d71
commit d031e59811

View File

@ -62,7 +62,27 @@ static enum fig_shape decode_shape(const char *s)
static void draw_text(int x, int y, const char *s, int dir, int dim,
enum fig_shape shape)
{
fig_text(x, y, s, dim, text_min, 0, COLOR_TEXT, LAYER_TEXT);
struct text txt = {
.s = s,
.size = dim,
.x = x,
.y = y,
.rot = 0,
.hor = text_min,
.vert = text_min,
};
switch (dir) {
case 0: /* right */
break;
case 1: /* up */
text_rot(&txt, 90);
break;
default:
assert(2 + 2 == 5);
}
text_fig(&txt, COLOR_TEXT, LAYER_TEXT);
}