From: albertogomcas Date: Fri, 20 Jun 2008 10:36:12 +0000 (+0000) Subject: (libhooke.py) find_graph_coords now takes finds the point closer to clicked point... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b521e8204c3537b9d2f0929dd46610d454b54b38;p=hooke.git (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 --- 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