Skip to content

Commit

Permalink
WAGE: Fixed h/v line
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Dec 27, 2015
1 parent b92e7f6 commit e4d9f88
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions engines/wage/design.cpp
Expand Up @@ -387,8 +387,8 @@ void Design::drawFilledEllipse(int x0, int y0, int x1, int y1, void (*plotProc)(
a *= 8*a; b1 = 8*b*b;

do {
drawHLine(x0, x1 + 1, y0, kColorBlack, plotProc, data);
drawHLine(x0, x1 + 1, y1, kColorBlack, plotProc, data);
drawHLine(x0, x1, y0, kColorBlack, plotProc, data);
drawHLine(x0, x1, y1, kColorBlack, plotProc, data);
e2 = 2*err;
if (e2 <= dy) { y0++; y1--; err += dy += a; } /* y step */
if (e2 >= dx || 2*err > dy) { x0++; x1--; err += dx += b1; } /* x step */
Expand All @@ -408,15 +408,15 @@ void Design::drawHLine(int x1, int x2, int y, int color, void (*plotProc)(int, i
if (x1 > x2)
SWAP(x1, x2);

for (int x = x1; x < x2; x++)
for (int x = x1; x <= x2; x++)
(*plotProc)(x, y, color, data);
}

void Design::drawVLine(int x, int y1, int y2, int color, void (*plotProc)(int, int, int, void *), void *data) {
if (y1 > y2)
SWAP(y1, y2);

for (int y = y1; y < y2; y++)
for (int y = y1; y <= y2; y++)
(*plotProc)(x, y, color, data);
}

Expand Down

0 comments on commit e4d9f88

Please sign in to comment.