enable warnings and fix issues reported by that
[PyX.git] / test / functional / test_canvas.py
blobe9466f2be5863389b6663d122fc56d91e5efe8f4
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)