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

eeshow/text.c (text_fig): correct vertical alignment of multi-line text

We used the first line as alignment point, not the last line.
This commit is contained in:
Werner Almesberger 2016-08-16 02:06:40 -03:00
parent 6fe19f52e9
commit a03f41a845

View File

@ -99,9 +99,15 @@ void text_fig(const struct text *txt, int color, unsigned layer)
const char *s;
int x = txt->x;
int y = txt->y;
unsigned multiline = 0;
x += rx(0, align(txt->size, txt->vert), txt->rot);
y += ry(0, align(txt->size, txt->vert), txt->rot);
for (s = txt->s; *s; s++)
if (*s == '\n')
multiline += NEWLINE_SKIP * txt->size;
x += rx(0, align(txt->size + multiline, txt->vert) - multiline,
txt->rot);
y += ry(0, align(txt->size + multiline, txt->vert) - multiline,
txt->rot);
while (1) {
s = strtok(tmp, "\n");
if (!s)