cvs: pear /Image_Canvas/Canvas SVG.php
| From: | Jesper Veggerby Hansen | Date: | Tue, 08 Nov 2005 19:00:36 +0000 |
| Subject: | cvs: pear /Image_Canvas/Canvas SVG.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-36162@lists.php.net to get a copy of this message | ||
nosey Tue Nov 8 14:00:36 2005 EDT
Modified files:
/pear/Image_Canvas/Canvas SVG.php
Log:
Fixed a bug causing rectangles not being displayed, if points were given in the wrong order
http://cvs.php.net/diff.php/pear/Image_Canvas/Canvas/SVG.php?r1=1.8&r2=1.9&ty=u
Index: pear/Image_Canvas/Canvas/SVG.php
diff -u pear/Image_Canvas/Canvas/SVG.php:1.8 pear/Image_Canvas/Canvas/SVG.php:1.9
--- pear/Image_Canvas/Canvas/SVG.php:1.8 Sat Nov 5 16:11:11 2005
+++ pear/Image_Canvas/Canvas/SVG.php Tue Nov 8 14:00:35 2005
@@ -21,7 +21,7 @@
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
* @license http://www.gnu.org/copyleft/lesser.html LGPL
License 2.1
- * @version CVS: $Id: SVG.php,v 1.8 2005/11/05 21:11:11 nosey Exp $
+ * @version CVS: $Id: SVG.php,v 1.9 2005/11/08 19:00:35 nosey Exp $
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
*/
@@ -505,10 +505,10 @@
*/
function rectangle($params)
{
- $x0 = $this->_getX($params['x0']);
- $y0 = $this->_getY($params['y0']);
- $x1 = $this->_getX($params['x1']);
- $y1 = $this->_getY($params['y1']);
+ $x0 = min($this->_getX($params['x0']),
$this->_getX($params['x1']));
+ $y0 = min($this->_getY($params['y0']),
$this->_getY($params['y1']));
+ $x1 = max($this->_getX($params['x0']),
$this->_getX($params['x1']));
+ $y1 = max($this->_getY($params['y0']),
$this->_getY($params['y1']));
$fillColor = (isset($params['fill']) ? $params['line'] : false);
$lineColor = (isset($params['line']) ? $params['line'] : false);