示例#1
0
 private void updateCameraTranslation(MotionEvent event) {
   PointF dragTranslation = new PointF();
   dragTranslation.set(
       event.getX() - getCurrentDragStart().x, event.getY() - getCurrentDragStart().y);
   CanvasCamera camera = getCanvasCamera();
   dragTranslation.x /= camera.getScale();
   dragTranslation.y /= camera.getScale();
   PointF startTranslation = getCameraDragStartTranslation();
   camera.setTranslation(
       dragTranslation.x + startTranslation.x, dragTranslation.y + startTranslation.y);
 }
示例#2
0
 public PointF getAsAbsoluteCoordinate(float x, float y) {
   CanvasCamera camera = getCanvasCamera();
   return camera.getAsUntransformedCoordinates(x, y);
 }