summaryrefslogtreecommitdiff
path: root/image/svg.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2008-07-28 23:26:54 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2008-07-28 23:26:54 +0000
commit430ac1db21c29c192252bf2d9065f2cb5019d6b3 (patch)
tree3dcf5667622c635033ce9a12eb702d77de0bf054 /image/svg.c
parent28f45754d500c850721b93d71c53d50b556e5b33 (diff)
downloadnetsurf-430ac1db21c29c192252bf2d9065f2cb5019d6b3.tar.gz
netsurf-430ac1db21c29c192252bf2d9065f2cb5019d6b3.tar.bz2
Convert svgtiny colours to BGR ordering when passing them to plotter APIs.
svn path=/trunk/netsurf/; revision=4784
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;
}