title: How to limit pan to canvas edges?
body: <p>I use fabricJS to edit an image, i've already implemented a zoom tool and a pan tool.</p>
  
  <p>The paning method :</p>
  
  <pre><code>if (!this.isStartedAction) return;
                      var x = ev.e.screenX,
                          y = ev.e.screenY;
                      this.canvas.relativePan({ x: x - this.firstPositionPan.x, y: y - this.firstPositionPan.y });
                      this.firstPositionPan.x = x;
                      this.firstPositionPan.y = y;
  </code></pre>
  
  <p>Problem is, regardless if i zoomed or not, when i use the pan i can move my image outside the canvas. I would like to limit the move to the edge of the canvas but i don't know how to do.</p>
  
  <p>Any suggestion?</p>