S.Chrobak S.Chrobak - 3 months ago 18
Javascript Question

Raphael.js function getBBox give back NAN/NAN/NAN in IE8

using Raphaƫl 2.1.4 - JavaScript Vector Library
do something like that:

var textDummy = paper.text(50,500, 'hello world').attr({fill: 'transparent', 'font-size': 14});
var textBox = textDummy.getBBox();


with chrome and firefox everything is fine,
but in IE8 it give back NaN/NaN/NaN,
par exemple textBox.height is NaN.

how i can fix this?

Answer

i found a workaround solution from this answer to the question "Raphael JS and Text positioning"

If i use _getBBox() instead of getBBox() everything is working in ie 8 also.

_getBBox() is undocumented but used internally by Raphael itself, and it works!