Revision: 5775
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5775&view=rev
Author:   mdboom
Date:     2008-07-17 17:40:47 +0000 (Thu, 17 Jul 2008)

Log Message:
-----------
Fix problem with NaNs at end of path.

Modified Paths:
--------------
    trunk/matplotlib/CHANGELOG
    trunk/matplotlib/src/agg_py_path_iterator.h

Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG  2008-07-17 17:16:12 UTC (rev 5774)
+++ trunk/matplotlib/CHANGELOG  2008-07-17 17:40:47 UTC (rev 5775)
@@ -1,3 +1,6 @@
+2008-07-17 Fix bug with NaNs at end of path (thanks, Andrew Straw for
+           the report) - MGD
+
 2008-07-12 Added support for external backends with the
            "module://my_backend" syntax - JDH
 

Modified: trunk/matplotlib/src/agg_py_path_iterator.h
===================================================================
--- trunk/matplotlib/src/agg_py_path_iterator.h 2008-07-17 17:16:12 UTC (rev 
5774)
+++ trunk/matplotlib/src/agg_py_path_iterator.h 2008-07-17 17:40:47 UTC (rev 
5775)
@@ -75,11 +75,13 @@
     {
         if (m_iterator >= m_total_vertices) return agg::path_cmd_stop;
         unsigned code = vertex_with_code(m_iterator++, x, y);
-        while ((MPL_isnan64(*x) || MPL_isnan64(*y)) &&
-                m_iterator < m_total_vertices)
-        {
+        if (MPL_isnan64(*x) || MPL_isnan64(*y)) {
+          do {
             vertex(m_iterator++, x, y);
-            code = agg::path_cmd_move_to;
+          } while ((MPL_isnan64(*x) || MPL_isnan64(*y)) &&
+                   m_iterator < m_total_vertices);
+          return (m_iterator >= m_total_vertices) ? agg::path_cmd_stop :
+                                                    agg::path_cmd_move_to;
         }
         return code;
     }


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
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to