2 $sur = new CairoImageSurface(FORMAT_ARGB32
, 120, 100);
3 $con = new CairoContext($sur);
5 $con->set_source_rgb ( 1, 1, 1);
8 $con->set_source_rgb ( 0, 0, 0);
9 $con->set_miter_limit (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);
17 $con->translate (50, 0);
19 $con->translate ( 0, 50);
20 $con->scale ( $xscale,$yscale);
21 $con->set_line_width ( 10.0 / $max_scale);
22 $con->move_to ( 10.0 / $xscale, 10.0 / $yscale);
23 $con->line_to ( 40.0 / $xscale, 10.0 / $yscale);
24 $con->line_to ( 10.0 / $xscale, 30.0 / $yscale);
28 $sur->write_to_png("miter-precision-php.png");