From 9d9eb59e5378e1fb98b1716f7c0caab69943d014 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 2 Jan 2012 10:58:06 +1030 Subject: [PATCH] Bug #18549 setThickness not working on GD / PNG output --- Image/Canvas/GD.php | 42 +++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/Image/Canvas/GD.php b/Image/Canvas/GD.php index c8e835b..b56d9ec 100644 --- a/Image/Canvas/GD.php +++ b/Image/Canvas/GD.php @@ -926,6 +926,20 @@ function line($params) parent::line($params); } + /** + * Get the line thickness + * + * @param mixed $lineStyle The line style to return the thickness of, + * false if the one explicitly set + * + * @return float A line thickness + * @access private + */ + function _getLineThickness($lineStyle = false) + { + return $this->_thickness; + } + /** * Parameter array: * @@ -1079,20 +1093,22 @@ function polygon($params) } } else { $prev_point = false; - if ($this->_antialias === 'driver') { - reset($polygon); - while (list(, $x) = each($polygon)) { - list(, $y) = each($polygon); - if ($prev_point) { - $this->_antialiasedLine( - $prev_point['X'], - $prev_point['Y'], - $x, - $y, - $lineColor - ); + if ($this->_getLineThickness() !== '0') { + if ($this->_antialias === 'driver' && $this->_getLineThickness() == '') { + reset($polygon); + while (list(, $x) = each($polygon)) { + list(, $y) = each($polygon); + if ($prev_point) { + $this->_antialiasedLine( + $prev_point['X'], + $prev_point['Y'], + $x, + $y, + $lineColor + ); + } + $prev_point = array('X' => $x, 'Y' => $y);; } - $prev_point = array('X' => $x, 'Y' => $y);; } } elseif (($line = $this->_getLineStyle($lineColor)) !== false) { reset($polygon);