While using patterns (from external images) as a fill, i.e., fill:url(img.gif) the library was always appending new pattern elements to the dom rather than re-using existing ones. This causes a noticeable flicker on some cases while there is a new http request to get the image file.
Try http://forio.com/simulate/latinovote/map on firefox and move the sliders to see the flickering version. If you inspect the dom you can see the new patterns being attend each time the slider moves.
Try http://latinovotemap.org with the fixed version to see that there is no flicker.
Great library btw!
Pattern now looks for existing images in the DOM before trying to cre…
…ate new ones
fixed the same problem for me. Thanks!
When the offset of the pattern fill matters, this fix introduces the problem that the position (translation) of the pattern is updated for every new elements using the same fill.
+1 for this pull request. here's the patch applied to version 2.1.2 https://gist.github.com/gka/6768991