]> Pileus Git - ~andy/gtk/commitdiff
GtkFrame: Fix a casting in the compute_child_allocation() method
authorClaudio Saavedra <csaavedra@igalia.com>
Tue, 13 Dec 2011 17:25:15 +0000 (19:25 +0200)
committerClaudio Saavedra <csaavedra@igalia.com>
Tue, 13 Dec 2011 18:26:30 +0000 (20:26 +0200)
The casting used to calculate the child allocation is confusing MAX().
As a result, width and height end up with negative values, which makes no sense.

https://bugzilla.gnome.org/show_bug.cgi?id=666109

gtk/gtkframe.c

index c2e1ad2f1784210ebdcdea228d4059421b776479..d4852fd063655c9379b6e9e788b08bc22b47c163 100644 (file)
@@ -835,10 +835,10 @@ gtk_frame_real_compute_child_allocation (GtkFrame      *frame,
 
   child_allocation->x = border_width + padding.left;
   child_allocation->y = border_width + top_margin;
-  child_allocation->width = MAX (1, (gint) allocation.width - (border_width * 2) -
-                                 padding.left - padding.right);
-  child_allocation->height = MAX (1, ((gint) allocation.height - child_allocation->y -
-                                      border_width - padding.bottom));
+  child_allocation->width = MAX (1, (gint) (allocation.width - (border_width * 2) -
+                                           padding.left - padding.right));
+  child_allocation->height = MAX (1, (gint) (allocation.height - child_allocation->y -
+                                            border_width - padding.bottom));
 
   child_allocation->x += allocation.x;
   child_allocation->y += allocation.y;