Font/Pango Text: fixed some weird color precision levels

cairo_set_source_rgba takes color and alpha parameters as 0..1.0 doubles. A fully opaque channel value (255)
was being set as 0.99609375 instead of 1.0, which it should be.
This commit is contained in:
Charles Dang 2017-07-15 01:21:06 +11:00
parent 2eefdd8948
commit 66cec73576

View file

@ -669,10 +669,10 @@ void pango_text::render(PangoLayout& layout, const PangoRectangle& rect, const s
/* set color (used for foreground). */
cairo_set_source_rgba(cr.get(),
foreground_color_.r / 256.0,
foreground_color_.g / 256.0,
foreground_color_.b / 256.0,
foreground_color_.a / 256.0
foreground_color_.r / 255.0,
foreground_color_.g / 255.0,
foreground_color_.b / 255.0,
foreground_color_.a / 255.0
);
pango_cairo_show_layout(cr.get(), &layout);