Raphael.Export
Raphael.Export copied to clipboard
The value of the attribute "dy" of the element <tspan> got changed after conversion
Before calling Paper.toSVG()
<tspan dy="4">Test </tspan>
After
<tspan dy="NaN">Test </tspan>
What am i missing?
Most likely you're not missing anything but stumbled upon a bug. I'll look into it when I get the chance and report back.
/**
* Computes tspan dy using font size. This formula was empircally determined
* using a best-fit line. Works well in both VML and SVG browsers.
* @param fontSize number
* @return number
*/
function computeTSpanDy(fontSize, line, lines) {
if ( fontSize === null ) fontSize = 10;
else if(typeof fontSize == 'string') fontSize = parseInt(fontSize);
//return fontSize * 4.5 / 13
return fontSize * 4.5 / 13 * ( line - .2 - lines / 2 ) * 3.5;
}
Thanks for that, I haven't had the time to look at it myself yet.