summaryrefslogtreecommitdiff
path: root/clutter
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2011-07-12 00:44:47 +0100
committerRobert Bragg <robert@linux.intel.com>2011-07-14 13:54:01 +0100
commitad234b303ca557c5f9bc34e0f4dfb0b3b619c865 (patch)
treebe0636267ec7ba510cb100190f8580984de4f5f3 /clutter
parent01cf70594dd29f7c80c73b0b89ca1d044777d04c (diff)
downloadclutter-ad234b303ca557c5f9bc34e0f4dfb0b3b619c865.tar.gz
paint-volume: don't round paint-volume from allocation
The implementation of _clutter_actor_set_default_paint_volume which simply uses the actor's allocation to determine a paint-volume was needlessly using the allocation rounded to integers by internally using clutter_actor_get_allocation_geometry instead of clutter_actor_get_allocation_box. This was introducing a lot of instability into the paint-volume due to the way rounding was done. The code has now been updated to use clutter_actor_get_allocation_box so we are dealing with the floating point allocation instead. Signed-off-by: Neil Roberts <neil@linux.intel.com> Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Diffstat (limited to 'clutter')
-rw-r--r--clutter/clutter-paint-volume.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/clutter/clutter-paint-volume.c b/clutter/clutter-paint-volume.c
index c4b2343d6..7b01e244b 100644
--- a/clutter/clutter-paint-volume.c
+++ b/clutter/clutter-paint-volume.c
@@ -952,7 +952,7 @@ _clutter_actor_set_default_paint_volume (ClutterActor *self,
GType check_gtype,
ClutterPaintVolume *volume)
{
- ClutterGeometry geometry = { 0, };
+ ClutterActorBox box;
if (check_gtype != G_TYPE_INVALID)
{
@@ -967,14 +967,14 @@ _clutter_actor_set_default_paint_volume (ClutterActor *self,
if (!clutter_actor_has_allocation (self))
return FALSE;
- clutter_actor_get_allocation_geometry (self, &geometry);
+ clutter_actor_get_allocation_box (self, &box);
/* a zero-sized actor has no paint volume */
- if (geometry.width == 0 || geometry.height == 0)
+ if (box.x1 == box.x2 || box.y1 == box.y2)
return FALSE;
- clutter_paint_volume_set_width (volume, geometry.width);
- clutter_paint_volume_set_height (volume, geometry.height);
+ clutter_paint_volume_set_width (volume, box.x2 - box.x1);
+ clutter_paint_volume_set_height (volume, box.y2 - box.y1);
return TRUE;
}