|
From: <ef...@us...> - 2010-06-01 02:20:59
|
Revision: 8358
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8358&view=rev
Author: efiring
Date: 2010-06-01 02:20:53 +0000 (Tue, 01 Jun 2010)
Log Message:
-----------
Line2D: fix point picking with zoom and pan, when line-clipping is in effect.
Closes 2871992.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/lines.py
Modified: trunk/matplotlib/lib/matplotlib/lines.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/lines.py 2010-06-01 01:30:19 UTC (rev 8357)
+++ trunk/matplotlib/lib/matplotlib/lines.py 2010-06-01 02:20:53 UTC (rev 8358)
@@ -305,6 +305,8 @@
# If line, return the nearby segment(s)
ind = segment_hits(mouseevent.x,mouseevent.y,xt,yt,pixels)
+ ind += self.ind_offset
+
# Debugging message
if False and self._label != u'':
print "Checking line",self._label,"at",mouseevent.x,mouseevent.y
@@ -496,12 +498,14 @@
def draw(self, renderer):
if self._invalidy or self._invalidx:
self.recache()
+ self.ind_offset = 0 # Needed for contains() method.
if self._subslice and self.axes:
# Need to handle monotonically decreasing case also...
x0, x1 = self.axes.get_xbound()
i0, = self._x.searchsorted([x0], 'left')
i1, = self._x.searchsorted([x1], 'right')
subslice = slice(max(i0-1, 0), i1+1)
+ self.ind_offset = subslice.start
self._transform_path(subslice)
if self._transformed_path is None:
self._transform_path()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|