Edit report at https://pear.php.net/bugs/bug.php?id=18507&edit=1
ID: 18507
Updated by: daniel.oconnor@gmail.com
Reported By: jblank at twu dot net
Summary: SVG output of multi-line axis labels is screwed up.
Status: Analyzed
Type: Bug
Package: Image_Canvas
Operating System: Debian
Package Version: 0.3.3
PHP Version: Irrelevant
Assigned To: nosey
Roadmap Versions:
New Comment:
@Nosey - I'm marking this package unmaintained for the moment; and am
just
going to apply this / other patches as needed.
Previous Comments:
------------------------------------------------------------------------
[2011-05-29 14:05:16] doconnor
-Assigned To:
+Assigned To: nosey
------------------------------------------------------------------------
[2011-05-29 14:04:45] doconnor
-Status: Open
+Status: Analyzed
Thanks for the patch Jessica. You mentioned screenshots - can you put
them on
imgur or something and link to this ticket by any chance?
------------------------------------------------------------------------
[2011-05-18 07:44:01] jessieleah
Added #patch
bug:18507;patch:fix_multiline_axis_labels.patch;revision:1305704641;.
------------------------------------------------------------------------
[2011-05-06 04:53:35] jessieleah
Description:
------------
See screenshots. If you output an SVG with multi-line axis
labels (on the X axis, at least), it incorrectly shoves the START
of the label down a little bit more for each line of length of the
label. For instance, the label "Test\nLabel\nOne" is three lines,
so it would be shoved down further than the label
"Testlabel\nTwo", which is two lines long.
SIMPLE FIX:
In SVG.php, instead of:
$textHeight = $this->textHeight($text);
go:
$lines = explode("\n",$text);
$textHeight = $this->textHeight($lines[0]);
Voila.
Expected result:
----------------
Labels should line up.
Actual result:
--------------
Labels do not line up.
------------------------------------------------------------------------