Solved blinking bug when recoloring with grey background

There was a problem passing colors to cairo_set_source_rgb.
Should be floats between 0 and 1.

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
Abdó Roig-Maranges 2012-07-30 21:37:24 +02:00 committed by Sebastian Ramacher
parent 1175985ae7
commit 9ed64ff606

View File

@ -434,9 +434,9 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo)
/* set background color */ /* set background color */
if (priv->zathura->global.recolor == true) { if (priv->zathura->global.recolor == true) {
GdkColor color = priv->zathura->ui.colors.recolor_light_color; GdkColor color = priv->zathura->ui.colors.recolor_light_color;
cairo_set_source_rgb(cairo, color.red, color.green, color.blue); cairo_set_source_rgb(cairo, color.red/65535.0, color.green/65535.0, color.blue/65535.0);
} else { } else {
cairo_set_source_rgb(cairo, 255, 255, 255); cairo_set_source_rgb(cairo, 1, 1, 1);
} }
cairo_rectangle(cairo, 0, 0, page_width, page_height); cairo_rectangle(cairo, 0, 0, page_width, page_height);
cairo_fill(cairo); cairo_fill(cairo);