title: Reloading JSON fails to render correctly in canvas with Fabric.js
body: <p>I have a bit of an issue with Fabric.js. I'm loading a JSON string in to the canvas and then at some time in the future I want to load more JSON in again (possibly the same JSON). The first load seems to work fine but the second load has an issue: the foreground path object doesn't appear, even though its bounding box is clickable. I'm not sure if this is a problem relating to the backgroundImage, or the way I'm clearing the canvas before I load the JSON again, or the actual way I'm loading JSON (or all three).</p>
  
  <p>I've put a simple fiddle <a href="https://jsfiddle.net/5j7ejLmk/" rel="nofollow">here</a>. </p>
  
  <pre><code>var j = { ... }; //json object (see fiddle)
  var c = new fabric.Canvas( document.getElementById("c") );
  
  c.loadFromJSON(j, function(objects, options) {
  c.renderAll();
  
  setTimeout(function(){
      c.backgroundImage=0;
      c.clear();
      c.renderAll();
  
      setTimeout(function(){
  
          c.loadFromJSON(j, function(objects, options) {
              c.renderAll();
              c.setActiveObject(c.item(0));
          });
  
      },3000);
  },3000);
  
  });
  </code></pre>
  
  <p>I create the initial canvas view from the JSON object, then clear it out after 3 seconds, then load it in again after another 3 seconds (this is just to simulate clicking a button or whatever in a real app).</p>
  
  <p>Would appreciate any help on this and apologies if this has been dealt with before.</p>
  
  <p>Cheers</p>
  
  <p>[EDIT] I've noticed that if I copy the JSON object in to a second variable so that i'm initialising two objects with the same content, and load that in the second loop, it will load again properly. Could the original JSON variable be getting modified or cached and that's causing the issue? (fiddle for this <a href="https://jsfiddle.net/5j7ejLmk/1/" rel="nofollow">here</a></p>