4 $sur = new CairoImageSurface(FORMAT_ARGB32
, $width, $height);
5 $con = new CairoContext($sur);
7 $dash = array(4.0, 2.0);
9 $con->setSourceRgb ( 1, 1, 1);
12 $con->setSourceRgb ( 0., 0., 0);
14 $con->translate ( 0.5, .5);
15 $con->setLineWidth ( 1); /* This is vital to reproduce the bug. */
17 /* First check simple rectangles */
18 $con->setSourceRgb ( 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->setDash ( $dash, 2, 0);
31 $con->setSourceRgb ( 1., 0., 0);
32 $con->rectangle ( -$width/4, -$height/4, $width, $height);
34 $con->setSourceRgb ( 0., 1., 0);
35 $con->rectangle ( $width+
$width/4, -$height/4, -$width, $height);
37 $con->setSourceRgb ( 0., 0., 1);
38 $con->rectangle ( -$width/4, $height+
$height/4, $width, -$height);
40 $con->setSourceRgb ( 1., 1., 0);
41 $con->rectangle ( $width+
$width/4, $height+
$height/4, -$width, -$height);
43 $sur->writeToPng("leaky-dashed-rectangle-php.png");