[Scummvm-git-logs] scummvm master -> 903569cab8ae8bc850a989fb57c69e6fd873dd08

bluegr bluegr at gmail.com
Fri Apr 26 12:08:41 CEST 2019


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:
903569cab8 GRAPHICS: Fix ManagedSurface dirty rects when drawing lines


Commit: 903569cab8ae8bc850a989fb57c69e6fd873dd08
    https://github.com/scummvm/scummvm/commit/903569cab8ae8bc850a989fb57c69e6fd873dd08
Author: Daniel (supsuper at gmail.com)
Date: 2019-04-26T13:08:38+03:00

Commit Message:
GRAPHICS: Fix ManagedSurface dirty rects when drawing lines

Fixes an invalidRect assert when drawing lines which don't go from top-left to bottom-right.

Changed paths:
    graphics/managed_surface.h


diff --git a/graphics/managed_surface.h b/graphics/managed_surface.h
index a7cf70f8..a11d05c 100644
--- a/graphics/managed_surface.h
+++ b/graphics/managed_surface.h
@@ -317,7 +317,7 @@ public:
 	 */
 	void drawLine(int x0, int y0, int x1, int y1, uint32 color) {
 		_innerSurface.drawLine(x0, y0, x1, y1, color);
-		addDirtyRect(Common::Rect(x0, y0, x1, y1));
+		addDirtyRect(Common::Rect(MIN(x0, x1), MIN(y0, y1), MAX(x0, x1), MAX(y0, y1)));
 	}
 
 	/**
@@ -325,7 +325,7 @@ public:
 	 */
 	void drawThickLine(int x0, int y0, int x1, int y1, int penX, int penY, uint32 color) {
 		_innerSurface.drawThickLine(x0, y0, x1, y1, penX, penY, color);
-		addDirtyRect(Common::Rect(x0, y0, x1 + penX, y1 + penY));
+		addDirtyRect(Common::Rect(MIN(x0, x1 + penX), MIN(y0, y1 + penY), MAX(x0, x1 + penX), MAX(y0, y1 + penY)));
 	}
 
 	/**





More information about the Scummvm-git-logs mailing list