private void drawLine(int x0, int y0, int x1, int y1) {
		//Bresenham's line algorithm

		boolean steep = Math.abs(y1 - y0) > Math.abs(x1 - x0);
		if (steep) {
			int tmp = y0;
			y0 = x0;
			x0 = tmp;

			tmp = y1;
			y1 = x1;
			x1 = tmp;
		}
		if (x0 > x1) {
			int tmp = x1;
			x1 = x0;
			x0 = tmp;

			tmp = y1;
			y1 = y0;
			y0 = tmp;
		}
		int deltaX = x1 - x0;
		int deltaY = Math.abs(y1 - y0);
		int error = deltaX / 2;
		int yStep;
		int y = y0;

		if (y0 < y1) {
			yStep = 1;
		}
		else {
			yStep = -1;
		}

		for (int x = x0; x <= x1; x++) {
			if (steep) {
				plot(y, x);
			}
			else {
				plot(x, y);
			}

			error = error - deltaY;
			if (error < 0) {
				y = y + yStep;
				error = error + deltaX;
			}
		}
	}