@@ -20,33 +20,31 @@ function draw_and_check_rectangle($x1, $y1, $x2, $y2)
20
20
21
21
echo 'Rectangle: ' ;
22
22
imagerectangle ($ img , $ x1 , $ y1 , $ x2 , $ y2 , $ black );
23
- draw_and_check_pixel (($ x1 + $ x2 ) / 2 , $ y1 );
24
- draw_and_check_pixel ($ x1 , ($ y1 + $ y2 ) / 2 );
25
- draw_and_check_pixel (($ x1 + $ x2 ) / 2 , $ y2 );
26
- draw_and_check_pixel ($ x2 , ($ y1 + $ y2 ) / 2 );
23
+ $ x = ($ x1 + $ x2 ) / 2 ;
24
+ $ y = ($ y1 + $ y2 ) / 2 ;
25
+ draw_and_check_pixel ($ x , $ y1 );
26
+ draw_and_check_pixel ($ x1 , $ y );
27
+ draw_and_check_pixel ($ x , $ y2 );
28
+ draw_and_check_pixel ($ x2 , $ y );
27
29
echo PHP_EOL ;
28
30
}
29
31
30
32
$ img = imagecreate (110 , 210 );
31
33
$ bgnd = imagecolorallocate ($ img , 255 , 255 , 255 );
32
- $ black = imagecolorallocate ($ img , 0 , 0 , 0 );
33
- $ red = imagecolorallocate ($ img , 255 , 0 , 0 );
34
+ $ black = imagecolorallocate ($ img , 0 , 0 , 0 );
35
+ $ red = imagecolorallocate ($ img , 255 , 0 , 0 );
34
36
35
- draw_and_check_rectangle (10 , 10 , 50 , 50 );
36
- draw_and_check_rectangle (50 , 60 , 10 , 100 );
37
- draw_and_check_rectangle (50 , 150 , 10 , 110 );
38
- draw_and_check_rectangle (10 , 200 , 50 , 160 );
37
+ draw_and_check_rectangle ( 10 , 10 , 50 , 50 );
38
+ draw_and_check_rectangle ( 50 , 60 , 10 , 100 );
39
+ draw_and_check_rectangle ( 50 , 150 , 10 , 110 );
40
+ draw_and_check_rectangle ( 10 , 200 , 50 , 160 );
39
41
imagesetthickness ($ img , 4 );
40
- draw_and_check_rectangle (60 , 10 , 100 , 50 );
41
- draw_and_check_rectangle (100 , 60 , 60 , 100 );
42
- draw_and_check_rectangle (100 , 150 , 60 , 110 );
43
- draw_and_check_rectangle (60 , 200 , 100 , 160 );
42
+ draw_and_check_rectangle ( 60 , 10 , 100 , 50 );
43
+ draw_and_check_rectangle (100 , 60 , 60 , 100 );
44
+ draw_and_check_rectangle (100 , 150 , 60 , 110 );
45
+ draw_and_check_rectangle ( 60 , 200 , 100 , 160 );
44
46
45
- imagepng ($ img , __DIR__ . '/bug53156.png ' );
46
- ?>
47
- --CLEAN--
48
- <?php
49
- @unlink (__DIR__ . '/bug53156.png ' );
47
+ //imagepng($img, __DIR__ . '/bug53156.png'); // debug
50
48
?>
51
49
--EXPECT--
52
50
Rectangle: ++++
0 commit comments