prevent double call of _cleanup, which harms usefiles (and is a bad idea in general)
[PyX.git] / test / functional / test_canvas.py
bloba5979c0f8aa7b51e0dcc2984ba74eb59e2606088
1 #!/usr/bin/env python
2 import sys; sys.path[:0] = ["../.."]
4 from pyx import *
6 c = canvas.canvas()
8 p = ( path.line(10*unit.u_pt, 10*unit.u_pt, 40*unit.u_pt, 40*unit.u_pt) +
9 path.line(10*unit.u_pt, 40*unit.u_pt, 40*unit.u_pt, 10*unit.u_pt) )
11 t1 = trafo.rotate(20)
12 t2 = trafo.translate(5,0)
13 t3 = trafo.mirror(10)
15 sc = canvas.canvas([t1, t2, t3])
16 c.insert(sc).stroke(p)
18 c.stroke(c.bbox().rect())
20 c.stroke(p.transformed(t1*t2*t3), [color.rgb.green, style.linestyle.dashed])
22 c.stroke(p, [color.rgb.red, style.linestyle.dotted, t3, t2, t1])
24 c.writeEPSfile("test_canvas", page_paperformat=document.paperformat.A4)
25 c.writePDFfile("test_canvas", page_paperformat=document.paperformat.A4)
26 c.writeSVGfile("test_canvas", page_paperformat=document.paperformat.A4)