DmitryBaranovskiy / raphael

JavaScript Vector Library
https://dmitrybaranovskiy.github.io/raphael/
MIT License
11.27k stars 1.67k forks source link

calling Element.toBack() in paper.forEach() creates an inifinite loop #707

Open silverspell opened 11 years ago

silverspell commented 11 years ago
paper.forEach(function(elem) {
    elem.toBack();
})

generates infinite loop.

Example:

var paper = new Raphael("paper", "100%", "100%");
paper.rect(0, 0, 50, 50);
paper.rect(0, 0, 150, 150);
paper.rect(0, 0, 250, 250);
paper.rect(0, 0, 350, 350);

paper.forEach(function(elem) {
    elem.toBack();
});
shamasis commented 11 years ago

An extremely creative and interesting issue, I must say! :-)