|
From: <jd...@us...> - 2008-07-29 17:47:53
|
Revision: 5922
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5922&view=rev
Author: jdh2358
Date: 2008-07-29 17:47:50 +0000 (Tue, 29 Jul 2008)
Log Message:
-----------
special case contains test for degenerate rectangle
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/patches.py
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py 2008-07-29 16:02:00 UTC (rev 5921)
+++ trunk/matplotlib/lib/matplotlib/patches.py 2008-07-29 17:47:50 UTC (rev 5922)
@@ -401,6 +401,10 @@
return self._rect_transform
def contains(self, mouseevent):
+ # special case the degernate rectangle
+ if self._width==0 or self._height==0:
+ return False, {}
+
x, y = self.get_transform().inverted().transform_point(
(mouseevent.x, mouseevent.y))
return (x >= 0.0 and x <= 1.0 and y >= 0.0 and y <= 1.0), {}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|