summaryrefslogtreecommitdiff
path: root/gtk/gtkaspectframe.c
diff options
context:
space:
mode:
authorGnome CVS User <gnomecvs@src.gnome.org>1997-11-25 07:15:41 +0000
committerGnome CVS User <gnomecvs@src.gnome.org>1997-11-25 07:15:41 +0000
commit33b94315803c6a7c9fe3826f0d4b11a26392137a (patch)
tree48c12426b37871cf7863595503e27f0f3472e8d3 /gtk/gtkaspectframe.c
parentc82e82dafc507469f48547702841f0946a888104 (diff)
downloadgdk-pixbuf-33b94315803c6a7c9fe3826f0d4b11a26392137a.tar.gz
Mon Nov 24 1997 Jay Painter <jpaint@serv.net>
gtk-dairiki-971117-2.patch gtk/gtkaspectframe.c (gtk_aspect_frame_size_allocate): When computing new dimensions of the subwidget, round to nearest integer rather than truncating. Mon Nov 24 1997 Jay Painter <jpaint@serv.net> gtk-dairiki-971117-1.patch * gtk/gtkvruler.c (gtk_vruler_draw_ticks): * gtk/gtkhruler.c (gtk_hruler_draw_ticks): Ensure that subticks always are drawn when they should be (sometimes they were getting drawn with zero length --- invisible). Also clear rectangle behind text labels to ensure they don't touch or overlap ticks. Mon Nov 24 1997 Jay Painter <jpaint@serv.net> * gtk/gtkaspectframe.c (gtk_aspect_frame_set): gtk-dairiki-971117-0.patch Clear window when aspect ratio or alignment is changed.
Diffstat (limited to 'gtk/gtkaspectframe.c')
-rw-r--r--gtk/gtkaspectframe.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtkaspectframe.c b/gtk/gtkaspectframe.c
index 2e6594fea..16feba5f0 100644
--- a/gtk/gtkaspectframe.c
+++ b/gtk/gtkaspectframe.c
@@ -319,14 +319,14 @@ gtk_aspect_frame_size_allocate (GtkWidget *widget,
GTK_CONTAINER (frame)->border_width -
GTK_WIDGET (frame)->style->klass->ythickness);
- if (ratio * height > width)
+ if (height > width / ratio)
{
child_allocation.width = width;
- child_allocation.height = width/ratio;
+ child_allocation.height = width/ratio + 0.5;
}
- else
+ else if (width > height * ratio)
{
- child_allocation.width = ratio*height;
+ child_allocation.width = ratio * height + 0.5;
child_allocation.height = height;
}