[goffice] Graphs: fix axis problem near zero.



commit 26547f3e486b358808c83348960d621471ec33b6
Author: Morten Welinder <terra gnome org>
Date:   Thu Aug 6 20:55:51 2009 -0400

    Graphs: fix axis problem near zero.

 ChangeLog                |    6 ++++++
 NEWS                     |    1 +
 goffice/graph/gog-axis.c |    4 ++--
 3 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4bd27d0..e0ac0c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-08-06  Morten Welinder  <terra gnome org>
+
+	* goffice/graph/gog-axis.c (map_linear_auto_bound): Avoid using an
+	integer number of steps for pull-in-0 threshold.  Fixes #590903, I
+	hope.
+
 2009-08-04  Jean Brefort  <jean brefort normalesup org>
 
 	* goffice/graph/gog-series.c (gog_series_get_xy_data): fix tests.
diff --git a/NEWS b/NEWS
index a64830f..c11c0bd 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Jean:
 Morten:
 	* Fix format localization problem. [#586567]
 	* Fix crash with Win32 configuration.  [#588138]
+	* Fix axis issues near zero.  [#590903]
 
 --------------------------------------------------------------------------
 goffice 0.7.8:
diff --git a/goffice/graph/gog-axis.c b/goffice/graph/gog-axis.c
index acd94e7..3304ee9 100644
--- a/goffice/graph/gog-axis.c
+++ b/goffice/graph/gog-axis.c
@@ -630,10 +630,10 @@ map_linear_auto_bound (GogAxis *axis, double minimum, double maximum, double *bo
 
 	/* pull to zero if its nearby (do not pull both directions to 0) */
 	if (bound[GOG_AXIS_ELEM_MIN] > 0 &&
-	    (bound[GOG_AXIS_ELEM_MIN] - 10. * step) < 0)
+	    (bound[GOG_AXIS_ELEM_MIN] - 9.99 * step) < 0)
 		bound[GOG_AXIS_ELEM_MIN] = 0;
 	else if (bound[GOG_AXIS_ELEM_MAX] < 0 &&
-	    (bound[GOG_AXIS_ELEM_MAX] + 10. * step) > 0)
+	    (bound[GOG_AXIS_ELEM_MAX] + 9.99 * step) > 0)
 		bound[GOG_AXIS_ELEM_MAX] = 0;
 
 	/* The epsilon shift can pull us away from a zero we want to



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]