Permalink
Browse files

Bug #18549 setThickness not working on GD / PNG output

  • Loading branch information...
1 parent 8d430f0 commit 9d9eb59e5378e1fb98b1716f7c0caab69943d014 @CloCkWeRX CloCkWeRX committed Jan 2, 2012
Showing with 29 additions and 13 deletions.
  1. +29 −13 Image/Canvas/GD.php
View
@@ -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);

0 comments on commit 9d9eb59

Please sign in to comment.