diff options
author | Owen Taylor <otaylor@redhat.com> | 1999-02-01 21:55:49 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1999-02-01 21:55:49 +0000 |
commit | 78ab1ea3fcb1311863967dba02c0707db3842562 (patch) | |
tree | b958cd1c86dbce7b0b341ad4cc46d8a3cedf76c8 /gtk | |
parent | a512f0b8419e248b557e5d4bc44017dcb26d2a19 (diff) | |
download | gtk+-78ab1ea3fcb1311863967dba02c0707db3842562.tar.gz |
Fixed problem with uints resulting in huge child allocations.
Mon Feb 1 15:14:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate):
Fixed problem with uints resulting in huge child
allocations.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkoptionmenu.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gtk/gtkoptionmenu.c b/gtk/gtkoptionmenu.c index bf42d863e8..c888625fca 100644 --- a/gtk/gtkoptionmenu.c +++ b/gtk/gtkoptionmenu.c @@ -307,11 +307,11 @@ gtk_option_menu_size_allocate (GtkWidget *widget, GTK_WIDGET (widget)->style->klass->xthickness) + 1; child_allocation.y = (GTK_CONTAINER (widget)->border_width + GTK_WIDGET (widget)->style->klass->ythickness) + 1; - child_allocation.width = (allocation->width - child_allocation.x * 2 - - OPTION_INDICATOR_WIDTH - OPTION_INDICATOR_SPACING * 5 - - CHILD_LEFT_SPACING - CHILD_RIGHT_SPACING) - 2; - child_allocation.height = (allocation->height - child_allocation.y * 2 - - CHILD_TOP_SPACING - CHILD_BOTTOM_SPACING) - 2; + child_allocation.width = MAX (1, (gint)allocation->width - child_allocation.x * 2 - + OPTION_INDICATOR_WIDTH - OPTION_INDICATOR_SPACING * 5 - + CHILD_LEFT_SPACING - CHILD_RIGHT_SPACING - 2); + child_allocation.height = MAX (1, (gint)allocation->height - child_allocation.y * 2 - + CHILD_TOP_SPACING - CHILD_BOTTOM_SPACING - 2); child_allocation.x += CHILD_LEFT_SPACING; child_allocation.y += CHILD_RIGHT_SPACING; |