summaryrefslogtreecommitdiff
path: root/kicad
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-08 03:44:43 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-09-08 03:44:43 (GMT)
commitfa130f5a73cee267856102d90bdb48bf5aaa1307 (patch)
treed8e53b91066c4c46dcb99b96859282fec6f461a6 /kicad
parent284ec4ec48610b5e9ee8b2fbd5a6697d9b0368f5 (diff)
downloadeeshow-fa130f5a73cee267856102d90bdb48bf5aaa1307.zip
eeshow-fa130f5a73cee267856102d90bdb48bf5aaa1307.tar.gz
eeshow-fa130f5a73cee267856102d90bdb48bf5aaa1307.tar.bz2
kicad/: support rotated text in page layouts
Diffstat (limited to 'kicad')
-rw-r--r--kicad/pl-common.h1
-rw-r--r--kicad/pl-parse.c4
-rw-r--r--kicad/pl-render.c2
3 files changed, 6 insertions, 1 deletions
diff --git a/kicad/pl-common.h b/kicad/pl-common.h
index 3f27fe1..1c454d6 100644
--- a/kicad/pl-common.h
+++ b/kicad/pl-common.h
@@ -42,6 +42,7 @@ struct pl_obj {
int font; /* tbtext (flags) */
enum text_align hor; /* tbtext */
enum text_align vert; /* tbtext */
+ float rotate; /* tbtext */
struct pl_obj *next;
};
diff --git a/kicad/pl-parse.c b/kicad/pl-parse.c
index 386e3db..7863466 100644
--- a/kicad/pl-parse.c
+++ b/kicad/pl-parse.c
@@ -283,6 +283,7 @@ static bool process_obj(struct pl_ctx *pl, const struct expr *e,
obj->font = 0;
obj->hor = text_min;
obj->vert = text_mid;
+ obj->rotate = 0;
for (; e; e = e->next) {
if (e->s) {
@@ -334,6 +335,9 @@ static bool process_obj(struct pl_ctx *pl, const struct expr *e,
} else if (!strcmp(s, "justify")) {
if (!process_justify(obj, next))
return 0;
+ } else if (!strcmp(s, "rotate")) {
+ if (!get_float(next, &obj->rotate))
+ return 0;
} else
warning("pl_obj: ignoring \"%s\"", s);
}
diff --git a/kicad/pl-render.c b/kicad/pl-render.c
index fd20992..8f4b940 100644
--- a/kicad/pl-render.c
+++ b/kicad/pl-render.c
@@ -163,7 +163,7 @@ static void render_text(const struct pl_ctx *pl, const struct pl_obj *obj,
.size = mil(obj->ey ? obj->ey : pl->ty),
.x = x,
.y = y,
- .rot = 0,
+ .rot = obj->rotate,
.hor = obj->hor,
.vert = obj->vert,
.style = text_normal, // @@@