vijithassar / d3-textwrap

painless cross-browser line wrapping for text passages in SVG projects built with D3.js
MIT License
154 stars 21 forks source link

Demo shows all text in pink box in IE11 #3

Closed willw-git closed 9 years ago

willw-git commented 10 years ago

In IE11, the demo http://bl.ocks.org/vijithassar/8278587 always displays in the left hand (pink) box, which ever of the three boxes is clicked. However, the formatted width does correctly reflect the chosen box.

ie11 demo

makker commented 9 years ago

I had this exact same issue and it's a deal breaker for me. This needs to be fixed for me to use this plugin. There's too many IE users to dismiss them. Otherwise this seems like great plugin in general :)

makker commented 9 years ago

Found the problem. The x and y of the bounds are ignored totally when foreignObject is used. Here's a version that fixes this problem https://googledrive.com/host/0BxN9lOIYoZDGM2tTa1l3UXMwU3M/d3textwrap.v2.makke.js Please test it properly! I just wanted to figure out why it didn't work in IE.

vijithassar commented 9 years ago

Just implemented this change. Thanks for the fix.