[clutter] actor: Clean up the allocate() checks



commit e1327f5591287fee58d8818564984ea01e95ca87
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Tue Jul 19 14:03:02 2011 +0100

    actor: Clean up the allocate() checks
    
    Move the conditions to their own boolean flags, to avoid making the
    if() incomprehensible.

 clutter/clutter-actor.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index b9f62b0..55f1fdd 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -6154,7 +6154,7 @@ clutter_actor_allocate (ClutterActor           *self,
   ClutterActorPrivate *priv;
   ClutterActorClass *klass;
   ClutterActorBox alloc;
-  gboolean child_moved;
+  gboolean origin_changed, child_moved, size_changed;
   gboolean stage_allocation_changed;
 
   g_return_if_fail (CLUTTER_IS_ACTOR (self));
@@ -6185,13 +6185,15 @@ clutter_actor_allocate (ClutterActor           *self,
         }
     }
 
+  origin_changed = (flags & CLUTTER_ABSOLUTE_ORIGIN_CHANGED);
+
   child_moved = (alloc.x1 != priv->allocation.x1 ||
                  alloc.y1 != priv->allocation.y1);
 
-  if (flags & CLUTTER_ABSOLUTE_ORIGIN_CHANGED ||
-      child_moved ||
-      alloc.x2 != priv->allocation.x2 ||
-      alloc.y2 != priv->allocation.y2)
+  size_changed = (alloc.x2 != priv->allocation.x2 ||
+                  alloc.y2 != priv->allocation.y2);
+
+  if (origin_changed || child_moved || size_changed)
     stage_allocation_changed = TRUE;
   else
     stage_allocation_changed = FALSE;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]