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.
This commit is contained in:
Emmanuele Bassi 2012-05-09 15:03:51 +01:00
parent 5ad1ec7cca
commit cb4f816840

View File

@ -8258,12 +8258,16 @@ clutter_actor_get_preferred_width (ClutterActor *self,
if (!priv->min_width_set) if (!priv->min_width_set)
request_min_width = cached_size_request->min_size; request_min_width = cached_size_request->min_size;
else else
request_min_width = info->minimum.width; request_min_width = info->margin.left
+ info->minimum.width
+ info->margin.right;
if (!priv->natural_width_set) if (!priv->natural_width_set)
request_natural_width = cached_size_request->natural_size; request_natural_width = cached_size_request->natural_size;
else else
request_natural_width = info->natural.width; request_natural_width = info->margin.left
+ info->natural.width
+ info->margin.right;
if (min_width_p) if (min_width_p)
*min_width_p = request_min_width; *min_width_p = request_min_width;
@ -8390,12 +8394,16 @@ clutter_actor_get_preferred_height (ClutterActor *self,
if (!priv->min_height_set) if (!priv->min_height_set)
request_min_height = cached_size_request->min_size; request_min_height = cached_size_request->min_size;
else else
request_min_height = info->minimum.height; request_min_height = info->margin.top
+ info->minimum.height
+ info->margin.bottom;
if (!priv->natural_height_set) if (!priv->natural_height_set)
request_natural_height = cached_size_request->natural_size; request_natural_height = cached_size_request->natural_size;
else else
request_natural_height = info->natural.height; request_natural_height = info->margin.top
+ info->natural.height
+ info->margin.bottom;
if (min_height_p) if (min_height_p)
*min_height_p = request_min_height; *min_height_p = request_min_height;