[clutter] actor: Be more conservative with the default paint volume
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] actor: Be more conservative with the default paint volume
- Date: Wed, 18 Jan 2012 16:09:23 +0000 (UTC)
commit 70679dc68ca805f0669cf9f94b4e441a50ed82f9
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Wed Jan 18 16:05:12 2012 +0000
actor: Be more conservative with the default paint volume
Check the allocation, when one is being used to initialize the paint
volume.
clutter/clutter-actor.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 45e2edc..2612755 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -4365,6 +4365,8 @@ clutter_actor_real_get_paint_volume (ClutterActor *self,
ClutterActor *child;
gboolean res;
+ clutter_paint_volume_set_from_allocation (volume, self);
+
/* this is the default return value: we cannot know if a class
* is going to paint outside its allocation, so we take the
* conservative approach.
@@ -4377,11 +4379,20 @@ clutter_actor_real_get_paint_volume (ClutterActor *self,
*/
if (priv->clip_to_allocation)
{
- clutter_paint_volume_set_from_allocation (volume, self);
+ float w, h;
- res = TRUE;
+ w = h = 0.f;
+ clutter_actor_box_get_size (&priv->allocation, &w, &h);
+
+ if (w >= 0 && h >= 0)
+ {
+ clutter_paint_volume_set_from_allocation (volume, self);
+ res = TRUE;
+ }
}
- else if (priv->has_clip)
+ else if (priv->has_clip &&
+ priv->clip.width >= 0 &&
+ priv->clip.height >= 0)
{
ClutterVertex origin;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]