diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2018-03-30 19:39:44 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2018-03-30 19:39:44 +0200 |
commit | ab592df5ddd1ee1e70135d3066e37ef4a13d801c (patch) | |
tree | bfe5edf7dc400399228ca00f06e791d132a170b5 /ext | |
parent | 6441b1bb31a1ebf40c54b57ef7420b12fe021e7c (diff) | |
parent | 76f421dd3a6eb91d848d76a6947546da38b6c564 (diff) | |
download | php-git-ab592df5ddd1ee1e70135d3066e37ef4a13d801c.tar.gz |
Merge branch 'PHP-7.2'
* PHP-7.2:
Fix #52070: imagedashedline() - dashed line sometimes is not visible
Diffstat (limited to 'ext')
-rw-r--r-- | ext/gd/libgd/gd.c | 1 | ||||
-rw-r--r-- | ext/gd/tests/bug52070.phpt | 25 | ||||
-rw-r--r-- | ext/gd/tests/bug52070.png | bin | 0 -> 2223 bytes |
3 files changed, 25 insertions, 1 deletions
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index e7bcf43360..504a040de4 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -1338,7 +1338,6 @@ void gdImageDashedLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color } else { wid = 1; } - wid = (int)(thick * sin(atan2(dy, dx))); vert = 1; d = 2 * dy - dx; diff --git a/ext/gd/tests/bug52070.phpt b/ext/gd/tests/bug52070.phpt new file mode 100644 index 0000000000..acf56e6b5b --- /dev/null +++ b/ext/gd/tests/bug52070.phpt @@ -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===
diff --git a/ext/gd/tests/bug52070.png b/ext/gd/tests/bug52070.png Binary files differnew file mode 100644 index 0000000000..5ce54b121b --- /dev/null +++ b/ext/gd/tests/bug52070.png |