From a0c4aedd32a06599f25b983cec5df9b4cf035adb Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Mon, 25 Jul 2016 01:50:07 -0300 Subject: [PATCH] sch2fig/fig.c (fig_glabel): support orientation 1 (up) --- sch2fig/fig.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/sch2fig/fig.c b/sch2fig/fig.c index 6ae66df..58960d4 100644 --- a/sch2fig/fig.c +++ b/sch2fig/fig.c @@ -131,6 +131,9 @@ void fig_glabel(int x, int y, const char *s, int dir, int dim, bool anchor_right = 1; switch (shape) { + case fig_unspec: + box = box_simple; + break; case fig_in: box = box_right; break; @@ -145,12 +148,19 @@ void fig_glabel(int x, int y, const char *s, int dir, int dim, } switch (dir) { - case 0: + case 0: /* left */ txt.rot = 0; txt.hor = text_max; dx = -1; break; - case 2: + case 1: /* up */ + txt.rot = 90; + txt.hor = text_min; + dx = 1; + box = flip_box(box); + anchor_right = !anchor_right; + break; + case 2: /* right */ txt.rot = 0; txt.hor = text_min; dx = 1; @@ -165,6 +175,18 @@ void fig_glabel(int x, int y, const char *s, int dir, int dim, shift_tip = dx * (GLABEL_OFFSET + half); switch (box) { + case box_simple: + n = 5; + text_shift(&txt, txt.hor, text_mid, shift_flat, 0); + text_rel(&txt, text_min, text_min, + -GLABEL_OFFSET, GLABEL_OFFSET, vx + 1, vy + 1); + text_rel(&txt, text_max, text_min, + GLABEL_OFFSET, GLABEL_OFFSET, vx + 2, vy + 2); + text_rel(&txt, text_max, text_max, + GLABEL_OFFSET, -GLABEL_OFFSET, vx + 3, vy + 3); + text_rel(&txt, text_min, text_max, + -GLABEL_OFFSET, -GLABEL_OFFSET, vx + 4, vy + 4); + break; case box_right: text_shift(&txt, txt.hor, text_mid, anchor_right ? shift_tip : shift_flat, 0);