title: Create tag (Rect + Text) with FabricJS
body: <p>I am calling a tag, a colored rectangle with an editable text on it.
  I dont want the Text become deformed, it must keep letter width and wraps lines if too small. The text should be centered in the rectangle.</p>
  
  <p>To do it, I need to create a subclass of Fabric Object, it appears i have 2 solutions:</p>
  
  <ol>
  <li><p>Use a LabeledRect like in <a href="http://fabricjs.com/fabric-intro-part-3/#subclassing" rel="nofollow">tutorials</a>, this is a Rect with a Text in attribute.</p></li>
  <li><p>Use a group with a Rect and a Textbox. But this is a group and i don't find any working solution to edit text while Textbox is in group. <a href="http://jsfiddle.net/Da7SP/28/" rel="nofollow">See fiddle</a>.</p>
  
  <pre><code>fabric.Tag = fabric.util.createClass(fabric.Group, {
  type: 'ce.tag',
  
  initialize: function() {
  
      options = {};
  
      options.top     = 10;
      options.left    = 10;
  
      var defaults    = {
          width:  300,
          height: 30,
          originX: 'center',
          originY: 'center'
      };
  
      var items   = [];
  
      items[0]    = new fabric.Rect($.extend({}, defaults, {
          fill: '#77AAFF',
      }));
  
      items[1]    = new fabric.Textbox('Nouvelle étiquette', $.extend({}, defaults, {
          textAlign: 'center',
          fontSize: 20
      }));
  
      this.callSuper('initialize', items, options);
  
  },
  });
  
  canvas.add(new fabric.Tag())
  </code></pre></li>
  </ol>
  
  <p>The problem with option #2 (and probably #1) is the text should be editable and this is not.</p>
  
  <p>I currently have some rendering issue with option #2, when unserializing, the fill property is reset to default (black). <a href="http://jsfiddle.net/Da7SP/31/" rel="nofollow">See fiddle</a>
  In fact, this is the Group's default and FabricJS applies delegated properties to objects. Juste set "delegatedProperties: {}" into the Tag declaration and no property is delegated.</p>
  
  <p><strong>NOTE:</strong> Using a group is not a good idea, there is many properties in many way there are delegated or share between group and its children.</p>