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.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to