title: fabricJS - Custom object is not drawn on canvas
body: <p>I'm experimenting with custom objects in fabricJS. I'm starting with a line drawed by myself. I know there's already an object for that but I want to understand what happens behind and to what degree I can modify things. So, I'm using a simple line for the beginning but for any reason it's not drawn on the canvas.</p>
  
  <p>It looks like the <code>_render</code> function is not called while <code>initialize</code> works fine. Can you please tell me what's wrong with my code?</p>
  
  <p><a href="https://jsfiddle.net/rwuw72ov/1/" rel="nofollow noreferrer">JSFiddle</a></p>
  
  <pre><code>fabric.CustomLine = fabric.util.createClass(fabric.Object, {
  
      type: 'customline',
  
      pos : {
          x1 : 0,
          y1 : 0,
          x2 : 0,
          y2 : 0
      },
  
      initialize: function (options) {
          options = options || {};
  
          this.callSuper('initialize', options);
  
          this.pos.x1 = options.x1 || 0;
          this.pos.y1 = options.y1 || 0;
          this.pos.x2 = options.x2 || 0;
          this.pos.y2 = options.y2 || 0;
      },
  
      _render : function (ctx) {
          ctx.beginPath();
          ctx.moveTo(this.pos.x1, this.pos.y1);
          ctx.lineTo(this.pos.x2, this.pos.y2);
          ctx.closePath();
  
          this._renderFill(ctx);
          this._renderStroke(ctx);
      }
  });
  </code></pre>
  
  <hr>
  
  <p><strong>EDIT:</strong></p>
  
  <p><a href="https://stackoverflow.com/questions/26565436/fabricjs-render-method-of-my-fabric-object-subclass-is-never-called">In this question</a> there's the same problem. It seems like one has to set <code>width</code> and <code>height</code> properties to <code>&gt; 0</code> but I don't understand why. I can't find this workaround in fabricJS source either.</p>