Use double temporaries when computing group size
authorOwen W. Taylor <otaylor@fishsoup.net>
Sat, 6 Jun 2009 15:28:02 +0000 (11:28 -0400)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Mon, 8 Jun 2009 10:07:05 +0000 (11:07 +0100)
If we use float temporaries when computing the bounds of
a group, then, depending on what variables are kept in registers
and what stored on the stack, the accumulated difference between
natural_width and min_width can be more than FLOAT_EPSILON.

Using double temporaries will eliminate the difference in most
cases, or, very rarely, reduce it to a last-bit error.

http://bugzilla.openedhand.com/show_bug.cgi?id=1632

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
clutter/clutter-group.c

index 0653e76..6efe931 100644 (file)
@@ -132,8 +132,8 @@ clutter_fixed_layout_get_preferred_width (GList  *children,
                                           gfloat *natural_width_p)
 {
   GList *l;
-  gfloat min_left, min_right;
-  gfloat natural_left, natural_right;
+  gdouble min_left, min_right;
+  gdouble natural_left, natural_right;
 
   min_left = 0;
   min_right = 0;
@@ -208,8 +208,8 @@ clutter_fixed_layout_get_preferred_height (GList  *children,
                                            gfloat *natural_height_p)
 {
   GList *l;
-  gfloat min_top, min_bottom;
-  gfloat natural_top, natural_bottom;
+  gdouble min_top, min_bottom;
+  gdouble natural_top, natural_bottom;
 
   min_top = 0;
   min_bottom = 0;