title: Grouping and Ungrouping Fabric.js objects
body: <p>I've created a kind of 'polygon selector' or 'polygon maker' using fabric.js. Each click creates a corner of the polygon, which can be selected, moved, etc... double clicking the original point 'closes' the polygon. At this point I take all of the circles/lines that make up the polygons and group them. So far so good.</p>
  
  <p>When such a group is double clicked, I would like it to ungroup and revert to movable nodes (i.e. moving the circles reshapes the polygon etc); but there's some strangeness going on - check out what happens when you move the circles, certain lines seem 'not joined' to the circles...</p>
  
  <p>I've already reviewed every group/ungroup related fabric.js thread (here/there/everywhere). None seem to cover the type of 'connected' objects I have here.</p>
  
  <p>The fiddle I put together to show the problem says it better than I can: <a href="http://jsfiddle.net/bhilleli/4v8mkw6q/" rel="noreferrer">http://jsfiddle.net/bhilleli/4v8mkw6q/</a></p>
  
  <p>The broken bit of code is @:</p>
  
  <pre><code>       //dbl clicked a group so lets ungroup it!
          items = p._objects; // grab the items from the group you want to
  
          // translate the group-relative coordinates to canvas relative ones
          p._restoreObjectsState();
          // remove the original group and add all items back to the canvas
          canvas.remove(p);
          for (var i = items.length - 1; i &gt;= 0; i--) {
              canvas.add(items[i]);
          }
          canvas.renderAll();
  </code></pre>