Browse Source

Found a culling bug in line drawing.

David Piuva 6 months ago
parent
commit
cc635673e5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Source/DFPSR/api/drawAPI.cpp

+ 1 - 1
Source/DFPSR/api/drawAPI.cpp

@@ -177,7 +177,7 @@ inline void drawLineSuper(const IMAGE_TYPE &target, int32_t x1, int32_t y1, int3
 	// Culling test to reduce wasted pixels outside of the image.
 	// Culling test to reduce wasted pixels outside of the image.
 	int32_t width = image_getWidth(target);
 	int32_t width = image_getWidth(target);
 	int32_t height = image_getHeight(target);	
 	int32_t height = image_getHeight(target);	
-	if ((x1 < 0 && x1 < 0) || (y1 < 0 && y1 < 0) || (x1 >= width && x1 >= width) || (y1 >= height && y1 >= height)) {
+	if ((x1 < 0 && x2 < 0) || (y1 < 0 && y2 < 0) || (x1 >= width && x2 >= width) || (y1 >= height && y2 >= height)) {
 		// Skip drawing because both points are outside of the same edge.
 		// Skip drawing because both points are outside of the same edge.
 		return;
 		return;
 	}
 	}