Reduce rounding error. (#154658, John Cupitt)

2004-10-06  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkpaned.c (gtk_paned_compute_position): Reduce rounding
	error.  (#154658, John Cupitt)
This commit is contained in:
Matthias Clasen 2004-10-07 03:44:58 +00:00 committed by Matthias Clasen
parent cd79561f8f
commit 002ceac808
5 changed files with 15 additions and 3 deletions

View File

@ -1,5 +1,8 @@
2004-10-06 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkpaned.c (gtk_paned_compute_position): Reduce rounding
error. (#154658, John Cupitt)
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected): Clear
the iter instead of returning it unmodified. (#154186, Jonathan Blandford)

View File

@ -1,5 +1,8 @@
2004-10-06 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkpaned.c (gtk_paned_compute_position): Reduce rounding
error. (#154658, John Cupitt)
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected): Clear
the iter instead of returning it unmodified. (#154186, Jonathan Blandford)

View File

@ -1,5 +1,8 @@
2004-10-06 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkpaned.c (gtk_paned_compute_position): Reduce rounding
error. (#154658, John Cupitt)
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected): Clear
the iter instead of returning it unmodified. (#154186, Jonathan Blandford)

View File

@ -1,5 +1,8 @@
2004-10-06 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkpaned.c (gtk_paned_compute_position): Reduce rounding
error. (#154658, John Cupitt)
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected): Clear
the iter instead of returning it unmodified. (#154186, Jonathan Blandford)

View File

@ -1180,9 +1180,9 @@ gtk_paned_compute_position (GtkPaned *paned,
else if (!paned->child1_resize && paned->child2_resize)
paned->child1_size = child1_req;
else if (child1_req + child2_req != 0)
paned->child1_size = allocation * ((gdouble)child1_req / (child1_req + child2_req));
paned->child1_size = allocation * ((gdouble)child1_req / (child1_req + child2_req)) + 0.5;
else
paned->child1_size = allocation * 0.5;
paned->child1_size = allocation * 0.5 + 0.5;
}
else
{
@ -1194,7 +1194,7 @@ gtk_paned_compute_position (GtkPaned *paned,
if (paned->child1_resize && !paned->child2_resize)
paned->child1_size += allocation - paned->last_allocation;
else if (!(!paned->child1_resize && paned->child2_resize))
paned->child1_size = allocation * ((gdouble) paned->child1_size / (paned->last_allocation));
paned->child1_size = allocation * ((gdouble) paned->child1_size / (paned->last_allocation)) + 0.5;
}
}