Browse Source

Fixed a bug in RectI clipping code

Marko Pintera 12 years ago
parent
commit
c853b80d25
1 changed files with 2 additions and 2 deletions
  1. 2 2
      CamelotUtility/Source/CmRectI.cpp

+ 2 - 2
CamelotUtility/Source/CmRectI.cpp

@@ -75,8 +75,8 @@ namespace CamelotFramework
 
 
 		x = newLeft;
 		x = newLeft;
 		y = newTop;
 		y = newTop;
-		width = newRight - newLeft;
-		height = newBottom - newTop;
+		width = std::max(0, newRight - newLeft);
+		height = std::max(0, newBottom - newTop);
 	}
 	}
 
 
 	void RectI::transform(const Matrix4& matrix)
 	void RectI::transform(const Matrix4& matrix)