Fix the ClutterRectangle border drawing

Apply a patch from Neil Roberts (bug 488) for fixing the drawing of the
rectangle border, by not overdrawing the rectangle on the border and by
doing the correct check on the border colour.
This commit is contained in:
Emmanuele Bassi 2007-08-31 11:58:20 +00:00
parent e812b0d875
commit b60c049e54
2 changed files with 15 additions and 8 deletions

View File

@ -1,3 +1,9 @@
2007-08-31 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-rectangle.c: Fix the border drawing: do not
overdraw the rectangle on the border and fix the check for
different border colour. (#488, Neil Roberts)
2007-08-29 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-effect.c: (clutter_effect_template_set_property):

View File

@ -98,8 +98,9 @@ clutter_rectangle_paint (ClutterActor *self)
cogl_color (&tmp_col);
/* this sucks, but it's the only way to make a border */
cogl_rectangle (0, 0,
geom.width, priv->border_width);
cogl_rectangle (priv->border_width, 0,
geom.width - priv->border_width,
priv->border_width);
cogl_rectangle (geom.width - priv->border_width,
priv->border_width,
@ -110,7 +111,7 @@ clutter_rectangle_paint (ClutterActor *self)
geom.width - priv->border_width,
priv->border_width);
cogl_rectangle (0, priv->border_width,
cogl_rectangle (0, 0,
priv->border_width,
geom.height - priv->border_width);
@ -122,8 +123,8 @@ clutter_rectangle_paint (ClutterActor *self)
cogl_rectangle (priv->border_width,
priv->border_width,
geom.width - priv->border_width,
geom.height - priv->border_width);
geom.width - priv->border_width * 2,
geom.height - priv->border_width * 2);
}
else
{
@ -509,9 +510,9 @@ clutter_rectangle_set_border_color (ClutterRectangle *rectangle,
priv = rectangle->priv;
if (priv->border_color.red != color->red &&
priv->border_color.green != color->green &&
priv->border_color.blue != color->blue &&
if (priv->border_color.red != color->red ||
priv->border_color.green != color->green ||
priv->border_color.blue != color->blue ||
priv->border_color.alpha != color->alpha)
{
g_object_ref (rectangle);