Changed the entire file structure to remove the .c includes from cairo.c
[phpCairo.git] / testcases / phpCairo / miter-precision.php
blob2131a8f9419931c3353c53a03e67ddffb150025a
1 <?
2 $sur = new CairoImageSurface(FORMAT_ARGB32, 120, 100);
3 $con = new CairoContext($sur);
5 $con->setSourceRgb ( 1, 1, 1);
6 $con->paint ();
8 $con->setSourceRgb ( 0, 0, 0);
9 $con->setMiterLimit (100000);
10 for ($xscale = 1; $xscale <= 1000; $xscale += 999)
11 for ($yscale = 1; $yscale <= 1000; $yscale += 999)
13 //$max_scale = ($xscale > $yscale) ? $xscale : $yscale;
14 $max_scale = max($xscale, $yscale);
15 $con->save ();
16 if ($xscale > 1)
17 $con->translate (50, 0);
18 if ($yscale > 1)
19 $con->translate ( 0, 50);
20 $con->scale ( $xscale,$yscale);
21 $con->setLineWidth ( 10.0 / $max_scale);
22 $con->moveTo ( 10.0 / $xscale, 10.0 / $yscale);
23 $con->lineTo ( 40.0 / $xscale, 10.0 / $yscale);
24 $con->lineTo ( 10.0 / $xscale, 30.0 / $yscale);
25 $con->stroke ();
26 $con->restore ();
28 $sur->writeToPng("miter-precision-php.png");