title: Centering Object with in canvas
body: <p>Below is how I am arranging a circle in the canvas clip using Fabric JS.</p>
  
  <pre><code>   $(".arrangeHorizntal").click(function(){
      if(checkSelection()){           
          selectedObj.top = clipRectangle.top+clipRectangle.height/2;    
          selectedObj.setCoords();
          canvas.renderAll();
      }
  
  })
  </code></pre>
  
  <p>However when I am zooming the canvas It is not actually center and it is way off to the center. So my guess is that because of scaling.</p>
  
  <p>How to handle it ? tried <code>centerObject</code> function, but that is for centering in canvas and not with in the rect. Any clues ?</p>
  
  <p><a href="https://i.stack.imgur.com/5ayAr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5ayAr.png" alt="enter image description here"></a></p>