summaryrefslogtreecommitdiff
path: root/image/svg.c
diff options
context:
space:
mode:
Diffstat (limited to 'image/svg.c')
-rw-r--r--image/svg.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/image/svg.c b/image/svg.c
index 29fb3be16..c15a1892b 100644
--- a/image/svg.c
+++ b/image/svg.c
@@ -104,13 +104,15 @@ bool svg_redraw(struct content *c, int x, int y,
transform[4] = x;
transform[5] = y;
+#define BGR(c) ((c) == svgtiny_TRANSPARENT ? TRANSPARENT : ((svgtiny_RED((c))) | (svgtiny_GREEN((c)) << 8) | (svgtiny_BLUE((c)) << 16)))
+
for (unsigned int i = 0; i != diagram->shape_count; i++) {
if (diagram->shape[i].path) {
ok = plot.path(diagram->shape[i].path,
diagram->shape[i].path_length,
- diagram->shape[i].fill,
+ BGR(diagram->shape[i].fill),
diagram->shape[i].stroke_width,
- diagram->shape[i].stroke,
+ BGR(diagram->shape[i].stroke),
transform);
if (!ok)
return false;
@@ -130,6 +132,8 @@ bool svg_redraw(struct content *c, int x, int y,
}
}
+#undef BGR
+
return true;
}