4 $sur = new CairoImageSurface(FORMAT_ARGB32
, $width, $height);
5 $con = new CairoContext($sur);
7 $dash = array(4.0, 2.0);
9 $con->set_source_rgb ( 1, 1, 1);
12 $con->set_source_rgb ( 0., 0., 0);
14 $con->translate ( 0.5, .5);
15 $con->set_line_width ( 1); /* This is vital to reproduce the bug. */
17 /* First check simple rectangles */
18 $con->set_source_rgb ( 0., 0., 0);
19 $con->rectangle ( -$width/4, -$height/4, $width, $height);
21 $con->rectangle ( $width+
$width/4, -$height/4, -$width, $height);
23 $con->rectangle ( -$width/4, $height+
$height/4, $width, -$height);
25 $con->rectangle ( $width+
$width/4, $height+
$height/4, -$width, -$height);
28 $con->set_dash ( $dash, 2, 0);
31 $con->set_source_rgb ( 1., 0., 0);
32 $con->rectangle ( -$width/4, -$height/4, $width, $height);
34 $con->set_source_rgb ( 0., 1., 0);
35 $con->rectangle ( $width+
$width/4, -$height/4, -$width, $height);
37 $con->set_source_rgb ( 0., 0., 1);
38 $con->rectangle ( -$width/4, $height+
$height/4, $width, -$height);
40 $con->set_source_rgb ( 1., 1., 0);
41 $con->rectangle ( $width+
$width/4, $height+
$height/4, -$width, -$height);
43 $sur->write_to_png("leaky-dashed-rectangle-php.png");