public static Point2D viewToWorld(Viewport viewport, double x, double y) {

		AffineTransform transform = new AffineTransform();

		transform.concatenate(new AffineTransform(new double[] { 1, 0, 0, 1,
				viewport.getX(), viewport.getY() }));

		transform.concatenate(new AffineTransform(new double[] {
				1 / viewport.getScale(), 0, 0, 1 / viewport.getScale() }));

		Point2D point = transform.transform(new Point2D.Double(x, y), null);
		return point;
	}