xref: /PHP-7.2/ext/gd/tests/bug40764.phpt (revision 17ccbeec)
1--TEST--
2Bug #40764 (line thickness not respected for horizontal and vertical lines)
3--SKIPIF--
4<?php
5	if (!extension_loaded('gd')) die("skip gd extension not available\n");
6?>
7--FILE--
8<?php
9$image=imagecreatetruecolor(400, 400);
10$white = imagecolorallocate($image, 255, 255, 255);
11$black = imagecolorallocate($image, 0, 0, 0);
12$red = imagecolorallocate($image, 255, 0, 0);
13
14imagefill($image, 0, 0, $white);
15imagesetthickness($image, 10);
16
17imageline($image, 200, 0, 200, 400, $black);
18imageline($image, 0, 200, 400, 200, $black);
19imageline($image, 0, 0, 392, 392, $black);
20
21imagesetthickness($image, 1);
22
23imageline($image, 200, 0, 200, 400, $red);
24imageline($image, 0, 200, 400, 200, $red);
25imageline($image, 0, 0, 392, 392, $red);
26print_r(imagecolorat($image, 195, 0));
27print_r(imagecolorat($image, 0, 195));
28
29?>
30--EXPECT--
3100
32