From 58cd498deda55fd1be1512307cde3b0256a09493 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Tue, 26 Jul 2016 20:39:08 -0300 Subject: [PATCH] sch2fig/lib.c (draw_text): support horizontal and vertical alignment --- sch2fig/lib.c | 5 +++-- sch2fig/lib.h | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sch2fig/lib.c b/sch2fig/lib.c index 24410c0..08ef3b9 100644 --- a/sch2fig/lib.c +++ b/sch2fig/lib.c @@ -22,6 +22,7 @@ #include "style.h" #include "fig.h" #include "text.h" +#include "sch.h" #include "lib.h" @@ -345,10 +346,10 @@ static void draw_text(const struct text_obj *text, int m[6]) .x = mx(text->x, text->y, m), .y = my(text->x, text->y, m), .rot = angle_add(text->orient / 10, matrix_to_angle(m)), - .hor = text_mid, - .vert = text_mid, }; + decode_alignment(&txt, text->hor_align, text->vert_align); + switch (txt.rot) { case 180: case 270: diff --git a/sch2fig/lib.h b/sch2fig/lib.h index 7ba88db..f9e6384 100644 --- a/sch2fig/lib.h +++ b/sch2fig/lib.h @@ -44,7 +44,6 @@ struct comp { }; - const struct comp *lib_find(const char *name); bool lib_field_visible(const struct comp *comp, int n); void lib_exec(const struct comp *comp, unsigned unit, int m[6]);