Commit 977b2498 authored by Stefan Haun's avatar Stefan Haun
Browse files

gfx: Fix line drawing algorithm

Lines have been one pixel too short.
parent 4f101232
...@@ -198,7 +198,7 @@ static void plot_line_low( ...@@ -198,7 +198,7 @@ static void plot_line_low(
int d = 2 * dy - dx; int d = 2 * dy - dx;
int y = y0; int y = y0;
for (int x = x0; x < x1; x++) { for (int x = x0; x <= x1; x++) {
if (t > 1) { if (t > 1) {
gfx_circle_fill(reg, x, y, t, c); gfx_circle_fill(reg, x, y, t, c);
} else { } else {
...@@ -231,7 +231,7 @@ static void plot_line_high( ...@@ -231,7 +231,7 @@ static void plot_line_high(
int d = 2 * dx - dy; int d = 2 * dx - dy;
int x = x0; int x = x0;
for (int y = y0; y < y1; y++) { for (int y = y0; y <= y1; y++) {
if (t > 1) { if (t > 1) {
gfx_circle_fill(reg, x, y, t, c); gfx_circle_fill(reg, x, y, t, c);
} else { } else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment