Skip to content

Commit

Permalink
Bug #18549 setThickness not working on GD / PNG output
Browse files Browse the repository at this point in the history
  • Loading branch information
CloCkWeRX committed Jan 2, 2012
1 parent 8d430f0 commit 9d9eb59
Showing 1 changed file with 29 additions and 13 deletions.
42 changes: 29 additions & 13 deletions Image/Canvas/GD.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:
*
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9d9eb59

Please sign in to comment.