|
From: <jo...@us...> - 2009-10-21 18:41:48
|
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.
|