summaryrefslogtreecommitdiff
path: root/kicad
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-26 01:15:57 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-26 01:40:30 -0300
commitdfd916f49f4552be1d1dc44c6e0dc925a50c4c3f (patch)
tree6de8be6c10ae905eb9b8d8279a321f1632370adb /kicad
parentae518b0432c49abb21229f632020f54a2b159903 (diff)
downloadeeshow-dfd916f49f4552be1d1dc44c6e0dc925a50c4c3f.tar.gz
eeshow-dfd916f49f4552be1d1dc44c6e0dc925a50c4c3f.tar.bz2
eeshow-dfd916f49f4552be1d1dc44c6e0dc925a50c4c3f.zip
kicad/: always initialize struct text.style
Diffstat (limited to 'kicad')
-rw-r--r--kicad/lib-render.c41
-rw-r--r--kicad/pl-render.c1
-rw-r--r--kicad/sch-render.c26
3 files changed, 37 insertions, 31 deletions
diff --git a/kicad/lib-render.c b/kicad/lib-render.c
index a2d4748..8c9e328 100644
--- a/kicad/lib-render.c
+++ b/kicad/lib-render.c
@@ -223,13 +223,14 @@ static void draw_pin_name(const struct comp *comp, const struct lib_pin *pin,
}
struct text txt = {
- .s = pin->name,
- .x = mx(pin->x + ox, pin->y + oy, m) + sx,
- .y = my(pin->x + ox, pin->y + oy, m) + sy,
- .size = pin->name_size,
- .rot = rot,
- .hor = comp->name_offset ? hor : text_mid,
- .vert = comp->name_offset ? text_mid : text_min,
+ .s = pin->name,
+ .x = mx(pin->x + ox, pin->y + oy, m) + sx,
+ .y = my(pin->x + ox, pin->y + oy, m) + sy,
+ .size = pin->name_size,
+ .rot = rot,
+ .hor = comp->name_offset ? hor : text_mid,
+ .vert = comp->name_offset ? text_mid : text_min,
+ .style = text_normal,
};
text_rot(&txt, matrix_to_angle(m));
@@ -275,13 +276,14 @@ static void draw_pin_num(const struct comp *comp, const struct lib_pin *pin,
}
struct text txt = {
- .s = pin->number,
- .x = mx(pin->x + ox, pin->y + oy, m) + sx,
- .y = my(pin->x + ox, pin->y + oy, m) + sy,
- .size = pin->number_size,
- .rot = rot,
- .hor = text_mid,
- .vert = comp->name_offset ? text_min : text_max,
+ .s = pin->number,
+ .x = mx(pin->x + ox, pin->y + oy, m) + sx,
+ .y = my(pin->x + ox, pin->y + oy, m) + sy,
+ .size = pin->number_size,
+ .rot = rot,
+ .hor = text_mid,
+ .vert = comp->name_offset ? text_min : text_max,
+ .style = text_normal,
};
text_rot(&txt, matrix_to_angle(m) % 180);
@@ -665,11 +667,12 @@ static void draw_text(const struct lib_text *text, struct gfx *gfx,
const int m[6])
{
struct text txt = {
- .s = text->s,
- .size = text->dim,
- .x = mx(text->x, text->y, m),
- .y = my(text->x, text->y, m),
- .rot = angle_add(text->orient / 10, matrix_to_angle(m)),
+ .s = text->s,
+ .size = text->dim,
+ .x = mx(text->x, text->y, m),
+ .y = my(text->x, text->y, m),
+ .rot = angle_add(text->orient / 10, matrix_to_angle(m)),
+ .style = text->style,
};
decode_alignment(&txt, text->hor_align, text->vert_align);
diff --git a/kicad/pl-render.c b/kicad/pl-render.c
index 62652e3..8787e05 100644
--- a/kicad/pl-render.c
+++ b/kicad/pl-render.c
@@ -161,6 +161,7 @@ static void render_text(const struct pl_ctx *pl, const struct pl_obj *obj,
.rot = 0,
.hor = obj->hor,
.vert = obj->vert,
+ .style = text_normal, // @@@
};
if (inc && *s) {
diff --git a/kicad/sch-render.c b/kicad/sch-render.c
index 55670fc..48015f6 100644
--- a/kicad/sch-render.c
+++ b/kicad/sch-render.c
@@ -74,23 +74,25 @@ static void do_hsheet_text(const struct sch_obj *obj,
assert(sheet->name && sheet->file);
struct text sheet_txt = {
- .size = sheet->name_dim,
- .x = obj->x,
- .y = obj->y,
- .rot = 0,
- .hor = text_min,
- .vert = text_min,
+ .size = sheet->name_dim,
+ .x = obj->x,
+ .y = obj->y,
+ .rot = 0,
+ .hor = text_min,
+ .vert = text_min,
+ .style = text_normal,
};
if (asprintf(&s, "Sheet: %s", sheet->name)) {}
sheet_txt.s = s; /* work around "const" mismatch */
struct text file_txt = {
- .size = sheet->file_dim,
- .x = obj->x,
- .y = obj->y,
- .rot = 0,
- .hor = text_min,
- .vert = text_max,
+ .size = sheet->file_dim,
+ .x = obj->x,
+ .y = obj->y,
+ .rot = 0,
+ .hor = text_min,
+ .vert = text_max,
+ .style = text_normal,
};
if (asprintf(&s, "File: %s", sheet->file)) {}
file_txt.s = s; /* work around "const" mismatch */