diff options
-rw-r--r-- | src/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -100,7 +100,7 @@ draw_line(int x0, int y0, int x1, int y1, Color clr) { | |||
100 | int x = x0; | 100 | int x = x0; |
101 | int y = y0; | 101 | int y = y0; |
102 | 102 | ||
103 | // Normalize the drawing direction to always draw from (x0, y0)->(x1, y1) | 103 | // Adjust the step direction and calculate deltas. |
104 | int x_step = 1; | 104 | int x_step = 1; |
105 | int y_step = 1; | 105 | int y_step = 1; |
106 | int dx = x1 - x0; | 106 | int dx = x1 - x0; |
@@ -114,7 +114,7 @@ draw_line(int x0, int y0, int x1, int y1, Color clr) { | |||
114 | dy = y0 - y1; | 114 | dy = y0 - y1; |
115 | } | 115 | } |
116 | 116 | ||
117 | // Precalculate line deltas. | 117 | // Precalculate 2 * deltas for x and y. |
118 | int ddx = dx + dx; | 118 | int ddx = dx + dx; |
119 | int ddy = dy + dy; | 119 | int ddy = dy + dy; |
120 | 120 | ||