mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-26 14:04:39 +02:00
sch2fig/sch.c (draw_text): move to dwg
This commit is contained in:
parent
8dddf961b6
commit
d70f8bc7fe
@ -365,6 +365,43 @@ void dwg_hlabel(int x, int y, const char *s, int dir, int dim,
|
||||
}
|
||||
|
||||
|
||||
/* ----- Text -------------------------------------------------------------- */
|
||||
|
||||
|
||||
void dwg_text(int x, int y, const char *s, int dir, int dim,
|
||||
enum dwg_shape shape)
|
||||
{
|
||||
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;
|
||||
case 2: /* left */
|
||||
txt.hor = text_max;
|
||||
break;
|
||||
case 3: /* down */
|
||||
text_rot(&txt, 90);
|
||||
txt.hor = text_max;
|
||||
break;
|
||||
default:
|
||||
assert(2 + 2 == 5);
|
||||
}
|
||||
|
||||
text_fig(&txt, COLOR_TEXT, LAYER_TEXT);
|
||||
}
|
||||
|
||||
|
||||
/* ----- Connections ------------------------------------------------------- */
|
||||
|
||||
|
||||
|
@ -32,6 +32,8 @@ void dwg_hlabel(int x, int y, const char *s, int dir, int dim,
|
||||
enum dwg_shape shape);
|
||||
void dwg_glabel(int x, int y, const char *s, int dir, int dim,
|
||||
enum dwg_shape shape);
|
||||
void dwg_text(int x, int y, const char *s, int dir, int dim,
|
||||
enum dwg_shape shape);
|
||||
|
||||
void dwg_junction(int x, int y);
|
||||
void dwg_noconn(int x, int y);
|
||||
|
@ -209,43 +209,6 @@ static enum dwg_shape decode_shape(const char *s)
|
||||
}
|
||||
|
||||
|
||||
/* ----- Text -------------------------------------------------------------- */
|
||||
|
||||
|
||||
static void draw_text(int x, int y, const char *s, int dir, int dim,
|
||||
enum dwg_shape shape)
|
||||
{
|
||||
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;
|
||||
case 2: /* left */
|
||||
txt.hor = text_max;
|
||||
break;
|
||||
case 3: /* down */
|
||||
text_rot(&txt, 90);
|
||||
txt.hor = text_max;
|
||||
break;
|
||||
default:
|
||||
assert(2 + 2 == 5);
|
||||
}
|
||||
|
||||
text_fig(&txt, COLOR_TEXT, LAYER_TEXT);
|
||||
}
|
||||
|
||||
|
||||
/* ----- Component fields -------------------------------------------------- */
|
||||
|
||||
|
||||
@ -494,7 +457,7 @@ bool sch_parse(struct sch_ctx *ctx, const char *line)
|
||||
if (sscanf(line, "Text Notes %d %d %d %d",
|
||||
&obj->x, &obj->y, &text->dir, &text->dim) == 4) {
|
||||
ctx->state = sch_text;
|
||||
obj->u.text.fn = draw_text;
|
||||
obj->u.text.fn = dwg_text;
|
||||
return 1;
|
||||
}
|
||||
if (sscanf(line, "Text GLabel %d %d %d %d %ms",
|
||||
|
Loading…
Reference in New Issue
Block a user