From 02badabad98a439b85e237fae064db51d55208b1 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 2 Jan 2012 11:10:14 +1030 Subject: [PATCH] Bug #18507 SVG output of multi-line axis labels is screwed up. --- Image/Canvas/SVG.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Image/Canvas/SVG.php b/Image/Canvas/SVG.php index fec7fac..8fb17ba 100644 --- a/Image/Canvas/SVG.php +++ b/Image/Canvas/SVG.php @@ -740,7 +740,8 @@ function addText($params) $attrs = (isset($params['attrs']) && is_array($params['attrs'])) ? $this->_getAttributes($params['attrs']) : null; - $textHeight = $this->textHeight($text); + $lines = explode("\n", $text); + $textHeight = $this->textHeight($lines[0]); if (!is_array($alignment)) { $alignment = array('vertical' => 'top', 'horizontal' => 'left');