title: FabricJS scale image to fit width / size
body: <p>How do i scale image to fit the container size correctly? I want a grid of two images and each image to fit the provided size.</p>
  
  <p><a href="https://codepen.io/peteringram0/pen/gebYWo?editors=0010" rel="noreferrer">https://codepen.io/peteringram0/pen/gebYWo?editors=0010</a></p>
  
  <pre><code>img.set({
      left: 0,
      top: 0,
      width: 300,
      height: 300
      // Scale image to fit width / height ?
   });
  </code></pre>
  
  <p>EDIT: Sorry i didn't explain my question very clearly. Im looking to position it within the grid but as a 'cover' type. <a href="https://codepen.io/peteringram0/pen/xWwZmy?editors=0011" rel="noreferrer">https://codepen.io/peteringram0/pen/xWwZmy?editors=0011</a>. E.g. in the link there are 4 images in a grid but the images are in the centre and are overflowing. I want to get each of the images vertically centred with no overflow outside the set size. Thanks (x should be in the centre, while keeping the aspect ratio)</p>