Skip to content

Commit 9d9eb59

Browse files
committed
Bug #18549 setThickness not working on GD / PNG output
1 parent 8d430f0 commit 9d9eb59

File tree

1 file changed

+29
-13
lines changed

1 file changed

+29
-13
lines changed

Image/Canvas/GD.php

+29-13
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,20 @@ function line($params)
926926
parent::line($params);
927927
}
928928

929+
/**
930+
* Get the line thickness
931+
*
932+
* @param mixed $lineStyle The line style to return the thickness of,
933+
* false if the one explicitly set
934+
*
935+
* @return float A line thickness
936+
* @access private
937+
*/
938+
function _getLineThickness($lineStyle = false)
939+
{
940+
return $this->_thickness;
941+
}
942+
929943
/**
930944
* Parameter array:
931945
*
@@ -1079,20 +1093,22 @@ function polygon($params)
10791093
}
10801094
} else {
10811095
$prev_point = false;
1082-
if ($this->_antialias === 'driver') {
1083-
reset($polygon);
1084-
while (list(, $x) = each($polygon)) {
1085-
list(, $y) = each($polygon);
1086-
if ($prev_point) {
1087-
$this->_antialiasedLine(
1088-
$prev_point['X'],
1089-
$prev_point['Y'],
1090-
$x,
1091-
$y,
1092-
$lineColor
1093-
);
1096+
if ($this->_getLineThickness() !== '0') {
1097+
if ($this->_antialias === 'driver' && $this->_getLineThickness() == '') {
1098+
reset($polygon);
1099+
while (list(, $x) = each($polygon)) {
1100+
list(, $y) = each($polygon);
1101+
if ($prev_point) {
1102+
$this->_antialiasedLine(
1103+
$prev_point['X'],
1104+
$prev_point['Y'],
1105+
$x,
1106+
$y,
1107+
$lineColor
1108+
);
1109+
}
1110+
$prev_point = array('X' => $x, 'Y' => $y);;
10941111
}
1095-
$prev_point = array('X' => $x, 'Y' => $y);;
10961112
}
10971113
} elseif (($line = $this->_getLineStyle($lineColor)) !== false) {
10981114
reset($polygon);

0 commit comments

Comments
 (0)