[clutter] actor: Include margin in explicit sizes for all cases



commit cb4f8168403e4509cdabdbd0b005fa1667fa71a3
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Wed May 9 15:03:51 2012 +0100

    actor: Include margin in explicit sizes for all cases
    
    When asking for the preferred width and height of an actor, in case
    only one of either the minimum or the natural width is set, the margin
    offsets should also be applied.

 clutter/clutter-actor.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 56b13d3..5ded50e 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -8258,12 +8258,16 @@ clutter_actor_get_preferred_width (ClutterActor *self,
   if (!priv->min_width_set)
     request_min_width = cached_size_request->min_size;
   else
-    request_min_width = info->minimum.width;
+    request_min_width = info->margin.left
+                      + info->minimum.width
+                      + info->margin.right;
 
   if (!priv->natural_width_set)
     request_natural_width = cached_size_request->natural_size;
   else
-    request_natural_width = info->natural.width;
+    request_natural_width = info->margin.left
+                          + info->natural.width
+                          + info->margin.right;
 
   if (min_width_p)
     *min_width_p = request_min_width;
@@ -8390,12 +8394,16 @@ clutter_actor_get_preferred_height (ClutterActor *self,
   if (!priv->min_height_set)
     request_min_height = cached_size_request->min_size;
   else
-    request_min_height = info->minimum.height;
+    request_min_height = info->margin.top
+                       + info->minimum.height
+                       + info->margin.bottom;
 
   if (!priv->natural_height_set)
     request_natural_height = cached_size_request->natural_size;
   else
-    request_natural_height = info->natural.height;
+    request_natural_height = info->margin.top
+                           + info->natural.height
+                           + info->margin.bottom;
 
   if (min_height_p)
     *min_height_p = request_min_height;



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