GRAPHICS: Fix discrepancy in the thick line drawing function

The shortcuts for horizontal and vertical lines should draw the extra
thickness pixels around the line, not below it or to the right
This commit is contained in:
Filippos Karapetis 2016-08-25 11:57:08 +03:00
parent a5b97a989c
commit 102fe0be9f

View File

@ -108,15 +108,11 @@ void drawThickLine2(int x1, int y1, int x2, int y2, int thick, int color, void (
int dy = abs(y2 - y1);
if (dx == 0) {
if (y1 > y2)
SWAP(y1, y2);
Common::Rect r(x1, y1, x1 + thick - 1, y2);
Common::Rect r(x1 - thick / 2, MIN(y1, y2), x1 + thick / 2, MAX(y1, y2));
drawFilledRect(r, color, plotProc, data);
return;
} else if (dy == 0) {
if (x1 > x2)
SWAP(x1, x2);
Common::Rect r(x1, y1, x2, y1 + thick - 1);
Common::Rect r(MIN(x1, x2), y1 - thick / 2, MAX(x1, x2), y1 + thick / 2);
drawFilledRect(r, color, plotProc, data);
return;
}