title: Canvas Zoom goes to point (0,0)
body: <p>I am having a problem in zooming the canvas. I have made a customized view in which I am drawing relationship diagrams now when I zoom out the canvas in goes to the position (0,0). I have seen different threads and questions but could not find appropriate answer. </p>
  
  <p>What i am doing in onDraw Method is.</p>
  
  <pre><code>  canvas.scale(mScaleFactor, mScaleFactor);
  </code></pre>
  
  <p>I have also seen the canvas.scale(x, y, px, py) method but i do not know how to get the pivot points of x and y.</p>
  
  <pre><code>public boolean onScale(ScaleGestureDetector detector) {
  
  mScaleFactor *= detector.getScaleFactor();
  // Don't let the object get too small or too large.
  mScaleFactor = Math.max(0.4f, Math.min(mScaleFactor, 5.0f));
  if(mScaleFactor&gt;=1)
     mScaleFactor=1f; 
  
  invalidate();
  return true;
  </code></pre>
  
  <p>}</p>