Revision: 7899
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7899&view=rev
Author:   jouni
Date:     2009-10-21 18:41:35 +0000 (Wed, 21 Oct 2009)

Log Message:
-----------
Raise an error in the pdf backend instead of outputting an invalid path if a 
Path object lacks initial moveto

Modified Paths:
--------------
    trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py     2009-10-21 
18:09:45 UTC (rev 7898)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py     2009-10-21 
18:41:35 UTC (rev 7899)
@@ -1206,8 +1206,12 @@
         last_points = None
         for points, code in path.iter_segments(transform, clip=clip):
             if code == Path.MOVETO:
+                # This is allowed anywhere in the path
                 cmds.extend(points)
                 cmds.append(Op.moveto)
+            elif last_points is None:
+                # The other operations require a previous point
+                raise ValueError, 'Path lacks initial MOVETO'
             elif code == Path.LINETO:
                 cmds.extend(points)
                 cmds.append(Op.lineto)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to