Changed the entire file structure to remove the .c includes from cairo.c
[phpCairo.git] / testcases / phpCairo / degenerate-pen.php
blob0755cd4a2ebd2cd12e0d0fe2d5589be208000152
1 <?
2 $sur = new CairoImageSurface(FORMAT_RGB24,165, 30);
3 $con = new CairoContext($sur);
4 $con->moveTo(0,0);
6 $con->setSourceRgb ( 1, 1, 1);
7 $con->paint ();
9 $con->setSourceRgb ( 0, 0, 0);
10 $con->moveTo(0,0);
11 $con->translate ( 5, 5);
13 /* First compress the pen to a vertical line. */
14 $con->rectangle ( 0, 0, 20, 20);
15 $con->curveTo ( 20 / 2, 0, 20, 20 / 2, 20, 20);
16 $con->save ();
18 $con->scale ( 0.00001, 1.0);
19 $con->stroke ();
21 $con->restore ();
23 $con->translate ( 5 + 20, 0);
25 /* Then compress the pen to a horizontal line. */
26 $con->rectangle ( 0, 0, 20, 20);
27 $con->curveTo ( 20 / 2, 0, 20, 20 / 2, 20, 20);
28 $con->save ();
30 $con->scale ( 1.0, 0.00001);
31 $con->stroke ();
33 $con->restore ();
35 $con->translate ( 5 + 20, 0);
37 /* Finally a line at an angle. */
38 $con->rectangle ( 0, 0, 20, 20);
39 $con->curveTo ( 20 / 2, 0, 20, 20 / 2, 20, 20);
40 $con->save ();
42 $con->rotate ( M_PI / 4.0);
43 $con->scale ( 0.00001, 1.0);
44 $con->stroke ();
46 $con->restore ();
47 $con->setSourceRgb ( 1, 1, 1);
48 $con->paint ();
50 $con->setSourceRgb ( 0, 0, 0);
51 $con->setLineJoin (LINE_JOIN_ROUND);
53 $con->translate ( 5, 5);
55 /* First compress the pen to a vertical line. */
56 $con->rectangle ( 0, 0, 20, 20);
57 $con->curveTo ( 20 / 2, 0, 20, 20 / 2, 20, 20);
58 $con->save ();
60 $con->scale ( 0.00001, 1.0);
61 $con->stroke ();
63 $con->restore ();
65 $con->translate ( 5 + 20, 0);
67 /* Then compress the pen to a horizontal line. */
68 $con->rectangle ( 0, 0, 20, 20);
69 $con->curveTo ( 20 / 2, 0, 20, 20 / 2, 20, 20);
70 $con->save ();
72 $con->scale ( 1.0, 0.00001);
73 $con->stroke ();
75 $con->restore ();
77 $con->translate ( 5 + 20, 0);
79 /* Finally a line at an angle. */
80 $con->rectangle ( 0, 0, 20, 20);
81 $con->curveTo ( 20 / 2, 0, 20, 20 / 2, 20, 20);
82 $con->save ();
84 $con->rotate ( M_PI / 4.0);
85 $con->scale ( 0.00001, 1.0);
86 $con->stroke ();
88 $con->restore ();
89 $sur->writeToPng("degenerate-pen-php.png");