diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 5257b746e..775137d6f 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -4464,8 +4464,6 @@ clutter_actor_get_preferred_size (ClutterActor *self, *natural_height_p = natural_height; } -#define FLOAT_EPSILON (1e-4) /* 1/1000 pixel is the precision used */ - /** * clutter_actor_get_preferred_width: * @self: A #ClutterActor @@ -4513,14 +4511,11 @@ clutter_actor_get_preferred_width (ClutterActor *self, &min_width, &natural_width); - if (natural_width < min_width - FLOAT_EPSILON) - { - g_warning ("Actor of type %s reported a natural width " - "of %.2f px lower than min width %.2f px", - G_OBJECT_TYPE_NAME (self), - natural_width, - min_width); - } + /* Due to accumulated float errors, it's better not to warn + * on this, but just fix it. + */ + if (natural_width < min_width) + natural_width = min_width; if (!priv->min_width_set) priv->request_min_width = min_width; @@ -4585,14 +4580,11 @@ clutter_actor_get_preferred_height (ClutterActor *self, &min_height, &natural_height); - if (natural_height < min_height - FLOAT_EPSILON) - { - g_warning ("Actor of type %s reported a natural height " - "of %.2f px lower than min height %.2f px", - G_OBJECT_TYPE_NAME (self), - natural_height, - min_height); - } + /* Due to accumulated float errors, it's better not to warn + * on this, but just fix it. + */ + if (natural_height < min_height) + natural_height = min_height; if (!priv->min_height_set) priv->request_min_height = min_height;