summaryrefslogtreecommitdiff
path: root/gtk/gtkframe.c
diff options
context:
space:
mode:
authorClaudio Saavedra <csaavedra@igalia.com>2011-12-13 19:25:15 +0200
committerClaudio Saavedra <csaavedra@igalia.com>2011-12-13 20:26:30 +0200
commit064204da9b4d17c66760c2b57fd20b4ca510d89d (patch)
treed232ef262a4e83934f7970f15905dc326445c9ee /gtk/gtkframe.c
parenta7f3a9ff7499bf001a2aca0b6ae4d73081615caf (diff)
downloadgtk+-064204da9b4d17c66760c2b57fd20b4ca510d89d.tar.gz
GtkFrame: Fix a casting in the compute_child_allocation() method
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
Diffstat (limited to 'gtk/gtkframe.c')
-rw-r--r--gtk/gtkframe.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c
index c2e1ad2f17..d4852fd063 100644
--- a/gtk/gtkframe.c
+++ b/gtk/gtkframe.c
@@ -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;