[Scummvm-cvs-logs] scummvm master -> 102fe0be9faa60e59d3703d53fd10db990fb8896

bluegr bluegr at gmail.com
Thu Aug 25 10:57:31 CEST 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
102fe0be9f GRAPHICS: Fix discrepancy in the thick line drawing function


Commit: 102fe0be9faa60e59d3703d53fd10db990fb8896
    https://github.com/scummvm/scummvm/commit/102fe0be9faa60e59d3703d53fd10db990fb8896
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2016-08-25T11:57:08+03:00

Commit Message:
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

Changed paths:
    graphics/primitives.cpp



diff --git a/graphics/primitives.cpp b/graphics/primitives.cpp
index ac1c58b..a879fc9 100644
--- a/graphics/primitives.cpp
+++ b/graphics/primitives.cpp
@@ -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;
 	}






More information about the Scummvm-git-logs mailing list