From 430ac1db21c29c192252bf2d9065f2cb5019d6b3 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Mon, 28 Jul 2008 23:26:54 +0000 Subject: Convert svgtiny colours to BGR ordering when passing them to plotter APIs. svn path=/trunk/netsurf/; revision=4784 --- image/svg.c | 8 ++++++-- 1 file 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; } -- cgit v1.2.3