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-Tag: 0.9.0~85 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0549cb6644719fa0e7397926ed31331ce0af04cf;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