[goffice] Fix distance evaluation for GocLine.



commit 17dac79be7d8da97ae5c099de39e37ea115c5a0f
Author: Jean Brefort <jean brefort normalesup org>
Date:   Wed Mar 3 15:11:51 2010 +0100

    Fix distance evaluation for GocLine.

 ChangeLog                 |    4 ++++
 goffice/canvas/goc-line.c |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0a12d86..7da88fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-03-03  Jean Brefort  <jean brefort normalesup org>
+
+	* goffice/canvas/goc-line.c (goc_line_distance): fix distance evaluation.
+
 2010-03-03  Valek Filippov  <frob gnome org>
 
 	* goffice/canvas/goc-arc.c (goc_arc_update_bounds),
diff --git a/goffice/canvas/goc-line.c b/goffice/canvas/goc-line.c
index 77109c6..1318c5b 100644
--- a/goffice/canvas/goc-line.c
+++ b/goffice/canvas/goc-line.c
@@ -197,7 +197,7 @@ goc_line_distance (GocItem *item, double x, double y, GocItem **near_item)
 	if (t > l)
 		return hypot (t - l, y);
 	style = go_styled_object_get_style (GO_STYLED_OBJECT (item));
-	t = y - style->line.width / 2.;
+	t = fabs (y) - ((style->line.width > 5)?  style->line.width/ 2.: 2.5);
 	/* FIXME: do we need to take the arrow end into account? */
 	return (t > 0.)? t: 0.;
 }



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