title: How to scale an image down to fit inside a canvas, without distorting the image?
body: <p>I have a fabric js canvas that I allow users to add external images to.  Often times the user adds images that are too large to fit the canvas and it's a little difficult for them to re-size them correctly.  </p>
  
  <p>I'd like to automatically scale the larger images down so that the image maintains it's aspect ratio but fits on the canvas.</p>
  
  <p>Is there something in the fabric.js api that does this or do I need to calculate a ratio and set the scale x\y?</p>
  
  <p>I've tried this but it distorts the image.</p>
  
  <pre><code> oImg.set({
                      left: _fabicCanvas.width / 2,
                      top: _fabicCanvas.height / 2,
                      scaleY: _fabicCanvas.height / oImg.height,
                      scaleX: _fabicCanvas.width / oImg.width
                  });
  </code></pre>