[empathy] rounded-rectangle: cairo_set_source_rgba() takes [0..1] arguments
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] rounded-rectangle: cairo_set_source_rgba() takes [0..1] arguments
- Date: Tue, 27 Mar 2012 13:15:57 +0000 (UTC)
commit 8df3bd2167cc3b0944f07c2843cdce26f81eb7ba
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu Mar 22 13:16:33 2012 -0400
rounded-rectangle: cairo_set_source_rgba() takes [0..1] arguments
And not [0..255] integers.
https://bugzilla.gnome.org/show_bug.cgi?id=672561
src/empathy-rounded-rectangle.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/src/empathy-rounded-rectangle.c b/src/empathy-rounded-rectangle.c
index 7b8951f..1de5eb4 100644
--- a/src/empathy-rounded-rectangle.c
+++ b/src/empathy-rounded-rectangle.c
@@ -45,7 +45,7 @@ draw_cb (ClutterCairoTexture *canvas,
EmpathyRoundedRectangle *self = EMPATHY_ROUNDED_RECTANGLE (canvas);
guint width, height;
guint border_width;
- guint tmp_alpha;
+ gdouble tmp_alpha;
gdouble radius;
width = self->priv->width;
@@ -55,14 +55,13 @@ draw_cb (ClutterCairoTexture *canvas,
/* compute the composited opacity of the actor taking into
* account the opacity of the color set by the user */
- tmp_alpha = clutter_actor_get_paint_opacity (CLUTTER_ACTOR (self))
- * self->priv->border_color.alpha
- / 255;
+ tmp_alpha = (clutter_actor_get_paint_opacity (CLUTTER_ACTOR (self))
+ * self->priv->border_color.alpha) / 255.;
cairo_set_source_rgba (cr,
- self->priv->border_color.red,
- self->priv->border_color.green,
- self->priv->border_color.blue,
+ self->priv->border_color.red / 255.,
+ self->priv->border_color.green / 255.,
+ self->priv->border_color.blue / 255.,
tmp_alpha);
cairo_set_line_width (cr, border_width);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]