private static int clamp(int coord, int max) {
		int d = MAX_PRINT_SIZE / 2;
		coord -= MAX_PRINT_SIZE / 2;
		if (coord + MAX_PRINT_SIZE > max)
			coord = max - MAX_PRINT_SIZE;
		if (coord < 0)
			coord = 0;
		return coord;
	}