public static void drawLine(LedGraphics lg, Point A, Point B) {
		if (A.x == B.x || A.y == B.y) {
			double x, y, w, h;
			x = A.x;
			y = A.y;
			w = B.x - A.x;
			h = B.y - A.y;
			if (w < 0) {
//				x = B.x;
				w = -w;
			}
			if (h < 0) {
//				y = B.y;
				h = -h;
			}
			w++;
			h++;
			
			lg.drawRect((int) Math.round(x), (int) Math.round(y), (int) Math.round(w),
					(int) Math.round(h));
			return;
		}

		double m = (B.y - A.y) / (B.x - A.x);
		if (Math.abs(m) < 1)
			for (int x = (int) A.x; (B.x - x) * Double.compare(B.x, A.x) >= 0; x += Double.compare(
					B.x, A.x))
				lg.drawPoint(x, (int) Math.round(A.y + m * (x - A.x)));
		else {
			m = (B.x - A.x) / (B.y - A.y);
			for (int y = (int) A.y; (B.y - y) * Double.compare(B.y, A.y) >= 0; y += Double.compare(
					B.y, A.y))
				lg.drawPoint((int) Math.round(A.x + m * (y - A.y)), y);
		}
	}