Skip to content

Commit

Permalink
Font/Pango Text: fixed some weird color precision levels
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Vultraz committed Jul 26, 2017
1 parent 2eefdd8 commit 66cec73
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/font/text.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 66cec73

Please sign in to comment.