1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
use Cairo\Context; |
|
|
|
|
4
|
|
|
use Cairo\Operator; |
|
|
|
|
5
|
|
|
use Cairo\Surface\Image; |
|
|
|
|
6
|
|
|
use Cairo\Surface\ImageFormat; |
|
|
|
|
7
|
|
|
|
8
|
|
|
$cisize = 10; |
9
|
|
|
$pad = 2; |
10
|
|
|
$width = $cisize * 6.5 + $pad; |
11
|
|
|
$height = $cisize * 3.5 + $pad; |
12
|
|
|
|
13
|
|
|
function drawCircle($context, $cisize, $x, $y) |
14
|
|
|
{ |
15
|
|
|
$context->save(); |
16
|
|
|
$context->translate($x, $y); |
17
|
|
|
$context->arc(0, 0, $cisize / 2, 0, 2 * M_PI); |
18
|
|
|
$context->fill(); |
19
|
|
|
$context->restore(); |
20
|
|
|
} |
21
|
|
|
|
22
|
|
|
function drawCircles($context, $cisize) |
23
|
|
|
{ |
24
|
|
|
drawCircle($context, $cisize, 0, $cisize * -0.1); |
25
|
|
|
drawCircle($context, $cisize, $cisize * 0.4, $cisize * 0.25); |
26
|
|
|
drawCircle($context, $cisize, $cisize * 2, 0); |
27
|
|
|
drawCircle($context, $cisize, $cisize * 4, 0); |
28
|
|
|
drawCircle($context, $cisize, $cisize * 6, 0); |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
$surface = new Image(ImageFormat::ARGB32, $width, $height); |
32
|
|
|
$context = new Context($surface); |
33
|
|
|
|
34
|
|
|
$context->translate($pad, $pad); |
35
|
|
|
$context->setSourceRgb(0, 1, 0); |
36
|
|
|
$context->setOperator(Operator::OVER); |
37
|
|
|
drawCircle($context, $cisize, $cisize * 0.5, $cisize * 1.5); |
38
|
|
|
$context->setSourceRgb(1, 0, 0); |
39
|
|
|
$context->setOperator(Operator::ADD); |
40
|
|
|
drawCircle($context, $cisize, $cisize * 0.75, $cisize * 1.75); |
41
|
|
|
$context->setSourceRgb(0, 1, 0); |
42
|
|
|
$context->setOperator(Operator::OVER); |
43
|
|
|
$context->translate($cisize * 2.5, $cisize * 0.6); |
44
|
|
|
drawCircles($context, $cisize); |
45
|
|
|
$context->setSourceRgb(1, 0, 0); |
46
|
|
|
$context->setOperator(Operator::ADD); |
47
|
|
|
$context->translate(0, $cisize * 2); |
48
|
|
|
drawCircles($context, $cisize); |
49
|
|
|
|
50
|
|
|
$surface->writeToPng(dirname(__FILE__).'/finer-grained-fallbacks-php.png'); |
51
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths