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); }
public PointF getAsAbsoluteCoordinate(float x, float y) { CanvasCamera camera = getCanvasCamera(); return camera.getAsUntransformedCoordinates(x, y); }