title: How to move a Path on a Canvas in Android?
body: <p>I am trying to make an Android paint application for finger painting and I am having trouble with moving the lines I draw.</p>
  
  <p>What I tried to do was offset the path of the currently selected line by the difference between the initial finger press coordinates and the current coordinates in OnTouchEvent during ACTION_MOVE.</p>
  
  <pre><code>case MotionEvent.ACTION_MOVE:
  selectline.getLine().offset(x - otherx, y - othery);
  </code></pre>
  
  <p>otherx and othery are set as the x and y coordinates during ACTION_MOVE and x and y are the current cursor coordinates. My lines are stored as a separate class containing the path, color, thickness and bounding box.</p>
  
  <p>What I got was the shape flying off the screen in the direction of my finger without stopping at the slightest movement. I tried using a matrix to move the path, but the result was the same.</p>
  
  <p>When I tried to insert a "do while" that would check whether the current coordinates would match the path's .computeBounds() rectangle center, but the program crashes as soon as I move my finger.</p>
  
  <p>Any help would be appreciated, thanks.</p>