From 0549cb6644719fa0e7397926ed31331ce0af04cf Mon Sep 17 00:00:00 2001 From: albertogomcas Date: Fri, 20 Jun 2008 10:36:12 +0000 Subject: [PATCH] (libhooke.py) find_graph_coords now takes finds the point closer to clicked point, and not justi n x axis as before (macro.py) uses workdir in hooke.conf instead of self.currentdir --- libhooke.py | 17 ++++++++--------- macro.py | 4 ++-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/libhooke.py b/libhooke.py index 533cc3e..7d1a887 100755 --- a/libhooke.py +++ b/libhooke.py @@ -254,17 +254,16 @@ class ClickedPoint: corresponds to the clicked point. ''' - #Ye Olde sorting algorithm... - index=0 best_index=0 - best_diff=10^9 #FIXME:hope we never go over this magic number, doing best_diff=max(xvector)-min(xvector) can be better... - for point in xvector: - diff=abs(point-self.absolute_coords[0]) - if diff