title: How to move and scale images together
body: <p>I want users to be able to scale and zoom two images together while keeping them in their correct relative positions to each other. I do this by using a scale gesture detector on one of the images, then expanding the gesture to the other image. My problem is that, while I can get the images to move together, as soon as I try to scale the second image, the translations get drastically off. Is their something that happens while scaling that I am unaware of? The info.parentPreCoords variable is set at the beginning of the scale gesture detector, before any changes are made to the parent (the base image).</p>
  
  <pre><code>int[] childPreCoords = new int[2];
  view.getLocationInWindow(childPreCoords);
  
  float[] differencePre = new float[]{-info.parentPreCoords[0] + view.getX(),
                  -info.parentPreCoords[1] + view.getY()};
  
  
  int[] parentPostCoords = new int[2];
  info.parent.getLocationInWindow(parentPostCoords);
  
  
  float[] differencePost = new float[]{info.parent.getX() +
                  (scale * (differencePre[0])),
  info.parent.getY() +  (scale * differencePre[1])};
  
  
  view.setScaleX(scale);
  view.setScaleY(scale);
  
  
  view.setX(differencePost[0]);
  view.setY(differencePost[1]);
  </code></pre>