draw2d icon indicating copy to clipboard operation
draw2d copied to clipboard

Infinite loop when when adding an SVG with text using SVGFigure class

Open antonio-goncalves opened this issue 4 years ago • 0 comments

Hello, I am trying to add an SVG to the canvas using SVGFigure class. https://github.com/freegroup/draw2d/blob/master/src/SVGFigure.js

Everything works fine if I add an SVG without text, but if I try to add an SVG with text (<text> element) the browser will freeze in an infinite loop.

After some debugging I identified where the loop happens, is on the do...while statement (line 235) inside importSVG method of SVGFigure class.

I have created two examples

Importing an SVG without text (works fine) https://jsfiddle.net/n3crL6me/

Importing an SVG with text (infinite loop) https://jsfiddle.net/5zjr7u1g/

Thanks in advance for the help

António Gonçalves

antonio-goncalves avatar Oct 17 '20 17:10 antonio-goncalves