[cairo-commit] [cairo-www] src/svgtopycairo.mdwn
cworth at freedesktop.org
Thu Nov 8 08:59:25 PST 2007
src/svgtopycairo.mdwn | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
Author: Donn <donn.ingle at gmail.com>
Date: Thu Nov 8 08:59:24 2007 -0800
Fixed a bug.
diff --git a/src/svgtopycairo.mdwn b/src/svgtopycairo.mdwn
index 2c7ed5c..552a76b 100644
@@ -4,6 +4,8 @@ This took a while, the pyparsing had me in knots, but now it's short and sweet.
Make sure you pass it a very simple SVG file -- one that has had all the shapes reduced to paths. Oh, and keep your canvas 400 by 400 or it may draw clear off the screen.
It re-uses the framework from my other recipe. You should be able to copy/paste and run, but you may need elementree and pyparsing first.
+Please forgive any bugs.
@@ -95,13 +97,14 @@ It re-uses the framework from my other recipe. You should be able to copy/paste
if command == "Z":
cairo_commands += "ctx.close_path();"
- command_list.append(cairo_commands) #Add them to the list
+ command_list.append(cairo_commands) #Add them to the list
+ cairo_commands = ""
#Draw it. Only stroked, to fill as per the SVG drawing is another whole story.
for c in command_list:
if len(sys.argv) < 2:
More information about the cairo-commit