|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-06-17 10:58 UTC] pajoye@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 23:00:01 2025 UTC |
Description: ------------ When drawing a polygon with the default thickness everything is fine; but when setting the thickness of the line > 1, I get strange results. It looks as if certain lines of the polygons are not being drawn with the correct thickness. Reproduce code: --------------- function getPolygon($width, $border_width, $sides) { $xcen = $width; $ycen = $width; $incr = 360/$sides; $angle = 180; $k = 0; $max_height = 0; for($j = 0; $j < $sides; $j++) { $points[$k] = $xcen + $width * sin(deg2rad($angle)) + $border_width; $k++; $points[$k] = $ycen + $width * cos(deg2rad($angle)) + $border_width; $max_height = max($max_height, $points[$k]); $k++; $angle += $incr; } $img = imagecreatetruecolor(2*$width+10, $max_height+$border_width+10); $bg = imagecolorallocate($img,255,255,255); ImageFill($img, 0, 0, $bg); imagecolorallocate($img, 255, 255, 255); $black = imagecolorallocate($img,0,0,0); imagesetthickness($img,$border_width); imagepolygon($img,$points,$sides,$black); header("Content-type: image/gif"); imagegif ($img); imagedestroy($img); } getPolygon(100, 5, 9); Expected result: ---------------- For 9 sides, it should be like http://www.gabber.nl/cp/geometry_1px.gif with a thicker line. Actual result: -------------- The output is http://www.gabber.nl/cp/geometry_5px.gif . This happens for most values of sides.