Преглед изворни кода

Fixed a bug in RectI clipping code

Marko Pintera пре 12 година
родитељ
комит
c853b80d25
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      CamelotUtility/Source/CmRectI.cpp

+ 2 - 2
CamelotUtility/Source/CmRectI.cpp

@@ -75,8 +75,8 @@ namespace CamelotFramework
 
 		x = newLeft;
 		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)