From 002ceac808b55958adc73a64bee1b4ffc14edb71 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 7 Oct 2004 03:44:58 +0000 Subject: [PATCH] Reduce rounding error. (#154658, John Cupitt) 2004-10-06 Matthias Clasen * gtk/gtkpaned.c (gtk_paned_compute_position): Reduce rounding error. (#154658, John Cupitt) --- ChangeLog | 3 +++ ChangeLog.pre-2-10 | 3 +++ ChangeLog.pre-2-6 | 3 +++ ChangeLog.pre-2-8 | 3 +++ gtk/gtkpaned.c | 6 +++--- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5265afbc94..2f7988e7a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-10-06 Matthias Clasen + * 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) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 5265afbc94..2f7988e7a5 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,8 @@ 2004-10-06 Matthias Clasen + * 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) diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 5265afbc94..2f7988e7a5 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,8 @@ 2004-10-06 Matthias Clasen + * 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) diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 5265afbc94..2f7988e7a5 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,8 @@ 2004-10-06 Matthias Clasen + * 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) diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index c484205f62..a6a4ef6823 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -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; } }