public rect ( float $x, float $y, float $width, float $height, float $style = '' ) | ||
$x | float | Abscissa of upper-left corner. |
$y | float | Ordinate of upper-left corner. |
$width | float | Width. |
$height | float | Height. |
$style | float | Style of rendering. Possible values are: - D or empty string: draw (default) - F: fill - DF or FD: draw and fill |
public function rect($x, $y, $width, $height, $style = '')
{
if ($x < 0) {
$x += $this->w;
}
if ($y < 0) {
$y += $this->h;
}
$style = Horde_String::upper($style);
if ($style == 'F') {
$op = 'f';
} elseif ($style == 'FD' || $style == 'DF') {
$op = 'B';
} else {
$op = 'S';
}
$x = $this->_toPt($x);
$y = $this->_toPt($y);
$width = $this->_toPt($width);
$height = $this->_toPt($height);
$this->_out(sprintf('%.2F %.2F %.2F %.2F re %s', $x, $this->hPt - $y, $width, -$height, $op));
}