private void correctCameraPosition() {
		Point2D camPos = gui.getController().getCameraPosition();
		double x = camPos.getX();
		double y = camPos.getY();
		Map map = gui.getController().getMap();

		if (getWidth() > map.getWidth() * TILE_SIZE) {
			x = (double) map.getWidth() / 2 - 0.5;
		} else if ((x + 0.5) * TILE_SIZE < getWidth() / 2) {
			x = ((double) getWidth() / 2 - 0.5) / TILE_SIZE - 0.5;
		} else if ((map.getWidth() - x - 0.5) * TILE_SIZE < getWidth() / 2) {
			x = map.getWidth() - ((double) getWidth() / 2 - 1) / TILE_SIZE - 0.5;
		}

		if (getHeight() > map.getHeight() * TILE_SIZE) {
			y = (double) map.getHeight() / 2 - 0.5;
		} else if ((y + 0.5) * TILE_SIZE < getHeight() / 2) {
			y = ((double) getHeight() / 2 - 0.5) / TILE_SIZE - 0.5;
		} else if ((map.getHeight() - y - 0.5) * TILE_SIZE < getHeight() / 2) {
			y = map.getHeight() - ((double) getHeight() / 2 - 1) / TILE_SIZE - 0.5;
		}

		camPos.setLocation(x, y);
	}