From 600eb078837264274b015591163b98afe4c5862b Mon Sep 17 00:00:00 2001 From: artemp Date: Wed, 2 Jan 2013 19:36:22 +0000 Subject: [PATCH] + convert colours to doubles in set_color --- src/cairo_renderer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cairo_renderer.cpp b/src/cairo_renderer.cpp index f8579948e..41ad3fb0f 100644 --- a/src/cairo_renderer.cpp +++ b/src/cairo_renderer.cpp @@ -1158,7 +1158,8 @@ void render_vector_marker(cairo_context & context, pixel_position const& pos, ma else if(attr.fill_flag) { double fill_opacity = attr.fill_opacity * opacity * attr.fill_color.opacity(); - context.set_color(attr.fill_color.r,attr.fill_color.g,attr.fill_color.b, fill_opacity); + context.set_color(attr.fill_color.r/255.0,attr.fill_color.g/255.0, + attr.fill_color.b/255.0, fill_opacity); context.fill(); } } @@ -1179,7 +1180,8 @@ void render_vector_marker(cairo_context & context, pixel_position const& pos, ma else if (attr.stroke_flag) { double stroke_opacity = attr.stroke_opacity * opacity * attr.stroke_color.opacity(); - context.set_color(attr.stroke_color.r,attr.stroke_color.g,attr.stroke_color.b, stroke_opacity); + context.set_color(attr.stroke_color.r/255.0,attr.stroke_color.g/255.0, + attr.stroke_color.b/255.0, stroke_opacity); context.set_line_width(attr.stroke_width); context.set_line_cap(line_cap_enum(attr.line_cap)); context.set_line_join(line_join_enum(attr.line_join));