Typo ;)
[phpCairo.git] / testcases / phpCairo / over-above-source.php
blob825c63299fc71e843973780dfab58d167d5cafd4
1 <?
2 $size = 40;
3 $pad = 2;
4 $width = ($pad + $size + $pad);
5 $height = $width;
6 $sur = new CairoImageSurface(FORMAT_ARGB32,$width,$height);
7 $con = new CairoContext($sur);
9 $con->translate($pad, $pad);
10 $con->move_to($size/2, $size/2);
11 $con->rel_line_to($size/2, 0);
12 $con->rel_line_to($size/-2, $size/2);
13 $con->close_path();
15 $con->set_operator(OPERATOR_SOURCE);
16 $con->set_source_rgba(1,0,0,0.5);
18 $con->fill();
20 $con->arc($size/2, $size/2, $size/4, 0, 2*M_PI);
21 $con->set_operator(OPERATOR_OVER);
22 $con->set_source_rgba(0,1,0,0.5);
24 $con->fill();
26 $sur->write_to_png("over-above-source-php.png");