Skip to content

Commit 2ec8611

Browse files
committed
revised bug53156.phpt
1 parent 72b73e2 commit 2ec8611

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

ext/gd/tests/bug53156.phpt

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,31 @@ function draw_and_check_rectangle($x1, $y1, $x2, $y2)
2020

2121
echo 'Rectangle: ';
2222
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);
2729
echo PHP_EOL;
2830
}
2931

3032
$img = imagecreate(110, 210);
3133
$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);
3436

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);
3941
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);
4446

45-
imagepng($img, __DIR__ . '/bug53156.png');
46-
?>
47-
--CLEAN--
48-
<?php
49-
@unlink(__DIR__ . '/bug53156.png');
47+
//imagepng($img, __DIR__ . '/bug53156.png'); // debug
5048
?>
5149
--EXPECT--
5250
Rectangle: ++++

0 commit comments

Comments
 (0)