Skip to content

Commit

Permalink
Fixed missing method rename, removed unwanted tabs
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.php.net/repository/pear/packages/Image_Canvas/trunk@222365 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
Jesper Veggerby Hansen committed Oct 25, 2006
1 parent 6023cce commit fa84978
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions Canvas/SVG.php
Expand Up @@ -425,7 +425,7 @@ function line($params)
$y1 = $this->_getY($params['y1']);
$color = (isset($params['color']) ? $params['color'] : false);

$attrs = (isset($params['attrs']) && is_array($params['attrs'])) ? $this->getAttributes($params['attrs']) : null;
$attrs = (isset($params['attrs']) && is_array($params['attrs'])) ? $this->_getAttributes($params['attrs']) : null;

$style = $this->_getLineStyle($color) . $this->_getFillStyle('transparent');
if ($style != '') {
Expand All @@ -436,7 +436,7 @@ function line($params)
'x2="' . round($x1) . '" ' .
'y2="' . round($y1) . '" ' .
'style="' . $style . '"' .
($attrs ? ' ' . $attrs : '') .
($attrs ? ' ' . $attrs : '') .
'/>',
$params
);
Expand All @@ -463,7 +463,7 @@ function polygon($params = array())
}
$style = $this->_getLineStyle($lineColor) . $this->_getFillStyle($fillColor);

$attrs = (isset($params['attrs']) && is_array($params['attrs'])) ? $this->getAttributes($params['attrs']) : null;
$attrs = (isset($params['attrs']) && is_array($params['attrs'])) ? $this->_getAttributes($params['attrs']) : null;

$first = true;
$spline = false;
Expand Down Expand Up @@ -502,7 +502,7 @@ function polygon($params = array())
'<path ' .
'd="' . $points . '" ' .
'style="' . $style . '"' .
($attrs ? ' ' . $attrs : '') .
($attrs ? ' ' . $attrs : '') .
'/>',
$params
);
Expand Down Expand Up @@ -531,8 +531,8 @@ function rectangle($params)
$fillColor = (isset($params['fill']) ? $params['line'] : false);
$lineColor = (isset($params['line']) ? $params['line'] : false);

$attrs = (isset($params['attrs']) && is_array($params['attrs'])) ? $this->getAttributes($params['attrs']) : null;
$attrs = (isset($params['attrs']) && is_array($params['attrs'])) ? $this->_getAttributes($params['attrs']) : null;
$style = $this->_getLineStyle($lineColor) . $this->_getFillStyle($fillColor);
if ($style != '') {
$this->_addElement(
Expand All @@ -542,7 +542,7 @@ function rectangle($params)
'width="' . round(abs($x1 - $x0)) . '" ' .
'height="' . round(abs($y1 - $y0)) . '" ' .
'style="' . $style . '"' .
($attrs ? ' ' . $attrs : '') .
($attrs ? ' ' . $attrs : '') .
'/>',
$params
);
Expand Down Expand Up @@ -571,7 +571,7 @@ function ellipse($params)
$fillColor = (isset($params['fill']) ? $params['line'] : false);
$lineColor = (isset($params['line']) ? $params['line'] : false);

$attrs = (isset($params['attrs']) && is_array($params['attrs'])) ? $this->getAttributes($params['attrs']) : null;
$attrs = (isset($params['attrs']) && is_array($params['attrs'])) ? $this->_getAttributes($params['attrs']) : null;

$style = $this->_getLineStyle($lineColor) . $this->_getFillStyle($fillColor);
if ($style != '') {
Expand All @@ -582,7 +582,7 @@ function ellipse($params)
'rx="' . round($rx) . '" ' .
'ry="' . round($ry) . '" ' .
'style="' . $style . '"' .
($attrs ? ' ' . $attrs : '') .
($attrs ? ' ' . $attrs : '') .
'/>',
$params
);
Expand Down Expand Up @@ -619,7 +619,7 @@ function pieslice($params)
$fillColor = (isset($params['fill']) ? $params['line'] : false);
$lineColor = (isset($params['line']) ? $params['line'] : false);

$attrs = (isset($params['attrs']) && is_array($params['attrs'])) ? $this->getAttributes($params['attrs']) : null;
$attrs = (isset($params['attrs']) && is_array($params['attrs'])) ? $this->_getAttributes($params['attrs']) : null;

$dv = max($v2, $v1) - min($v2, $v1);
if ($dv >= 360) {
Expand All @@ -640,7 +640,7 @@ function pieslice($params)
round($x2) . ',' . round($y2) . ' ' .
'Z" ' .
'style="' . $style . '"' .
($attrs ? ' ' . $attrs : '') .
($attrs ? ' ' . $attrs : '') .
'/>',
$params
);
Expand Down Expand Up @@ -698,8 +698,8 @@ function addText($params)
$color = (isset($params['color']) ? $params['color'] : false);
$alignment = (isset($params['alignment']) ? $params['alignment'] : false);

$attrs = (isset($params['attrs']) && is_array($params['attrs'])) ? $this->getAttributes($params['attrs']) : null;
$attrs = (isset($params['attrs']) && is_array($params['attrs'])) ? $this->_getAttributes($params['attrs']) : null;
$textHeight = $this->textHeight($text);

if (!is_array($alignment)) {
Expand Down Expand Up @@ -764,8 +764,8 @@ function addText($params)
$textOpacity :
''
) . ';' . $align . '"' .
($attrs ? ' ' . $attrs : '') .
'>' .
($attrs ? ' ' . $attrs : '') .
'>' .
htmlspecialchars($text) .
'</text>' . "\n" .
$this->_indent . '</g>',
Expand All @@ -791,8 +791,8 @@ function image($params)
$y = $this->_getY($params['y']);
$filename = $params['filename'];

$attrs = (isset($params['attrs']) && is_array($params['attrs'])) ? $this->getAttributes($params['attrs']) : null;
$attrs = (isset($params['attrs']) && is_array($params['attrs'])) ? $this->_getAttributes($params['attrs']) : null;
list($width, $height, $type, $attr) = getimagesize($filename);
$width = (isset($params['width']) ? $params['width'] : $width);
$height = (isset($params['height']) ? $params['height'] : $height);
Expand All @@ -803,12 +803,12 @@ function image($params)
fclose($file);

$data = 'data:' . image_type_to_mime_type($type) . ';base64,' . base64_encode($filedata);
$this->_addElement(
'<image xlink:href="' . $data . '" x="' . $x . '" y="' . $y . '"' .
($width ? ' width="' . $width . '"' : '') .
($height ? ' height="' . $height . '"' : '') .
($attrs ? ' ' . $attrs : '') .
($attrs ? ' ' . $attrs : '') .
' preserveAspectRatio="none"/>',
$params
);
Expand Down Expand Up @@ -853,16 +853,16 @@ function endGroup()
function show($param = false)
{
parent::show($param);
$attrs = (isset($param['attrs']) && is_array($param['attrs'])) ? $this->getAttributes($param['attrs']) : null;
$attrs = (isset($param['attrs']) && is_array($param['attrs'])) ? $this->_getAttributes($param['attrs']) : null;
$output = '<?xml version="1.0" encoding="' . $this->_encoding . '"?>' . "\n" .
'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"' . "\n\t" .
' "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">' . "\n" .
'<svg width="' . $this->_width . '" height="' . $this->_height .
'" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"' .
($attrs ? ' ' . $attrs : '') .
'>' . "\n" .
($attrs ? ' ' . $attrs : '') .
'>' . "\n" .
($this->_defs ?
' <defs>' . "\n" .
$this->_defs .
Expand All @@ -886,15 +886,15 @@ function save($param = false)
{
parent::save($param);

$attrs = (isset($param['attrs']) && is_array($param['attrs'])) ? $this->_getAttributes($param['attrs']) : null;
$attrs = (isset($param['attrs']) && is_array($param['attrs'])) ? $this->_getAttributes($param['attrs']) : null;

$output = '<?xml version="1.0" encoding="'. $this->_encoding . '"?>' . "\n" .
'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"' . "\n\t" .
' "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">' . "\n" .
'<svg width="' . $this->_width . '" height="' . $this->_height .
'" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"' .
($attrs ? ' ' . $attrs : '') .
'>' . "\n" .
'" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"' .
($attrs ? ' ' . $attrs : '') .
'>' . "\n" .
($this->_defs ?
' <defs>' . "\n" .
$this->_defs .
Expand Down Expand Up @@ -966,14 +966,14 @@ function toHtml($params)
* @return array
*/
function _getAttributes($attrs)
{
{
$string = '';
foreach ($attrs as $key => $value) {
$string .= ' ' . $key . '="' . $value . '"';
}
return $string;
foreach ($attrs as $key => $value) {
$string .= ' ' . $key . '="' . $value . '"';
}
return $string;
}
}

Expand Down

0 comments on commit fa84978

Please sign in to comment.