mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
Merge branch 'PHP-7.2'
* PHP-7.2: Fix #52070: imagedashedline() - dashed line sometimes is not visible
This commit is contained in:
commit
ab592df5dd
3 changed files with 25 additions and 1 deletions
|
@ -1338,7 +1338,6 @@ void gdImageDashedLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color
|
||||||
} else {
|
} else {
|
||||||
wid = 1;
|
wid = 1;
|
||||||
}
|
}
|
||||||
wid = (int)(thick * sin(atan2(dy, dx)));
|
|
||||||
vert = 1;
|
vert = 1;
|
||||||
|
|
||||||
d = 2 * dy - dx;
|
d = 2 * dy - dx;
|
||||||
|
|
25
ext/gd/tests/bug52070.phpt
Normal file
25
ext/gd/tests/bug52070.phpt
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #52070 (imagedashedline() - dashed line sometimes is not visible)
|
||||||
|
--SKIPIF--
|
||||||
|
<?php
|
||||||
|
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||||
|
?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
$im = imagecreate(1200, 800);
|
||||||
|
$background_color = imagecolorallocate($im, 40, 40, 40);
|
||||||
|
$color = imagecolorallocate($im, 255, 255, 255);
|
||||||
|
imagedashedline($im, 800, 400, 300, 400, $color);
|
||||||
|
imagedashedline($im, 800, 400, 300, 800, $color);
|
||||||
|
imagedashedline($im, 800, 400, 400, 800, $color);
|
||||||
|
imagedashedline($im, 800, 400, 500, 800, $color);
|
||||||
|
imagedashedline($im, 800, 400, 600, 800, $color);
|
||||||
|
imagedashedline($im, 800, 400, 700, 800, $color);
|
||||||
|
imagedashedline($im, 800, 400, 800, 800, $color);
|
||||||
|
include_once __DIR__ . '/func.inc';
|
||||||
|
test_image_equals_file(__DIR__ . '/bug52070.png', $im);
|
||||||
|
?>
|
||||||
|
===DONE===
|
||||||
|
--EXPECT--
|
||||||
|
The images are equal.
|
||||||
|
===DONE===
|
BIN
ext/gd/tests/bug52070.png
Normal file
BIN
ext/gd/tests/bug52070.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
Loading…
Add table
Add a link
Reference in a new issue