(svn r11169) -Fix [FS#1255]: obiwan in Blitter::Drawline(), which caused it to clip too much at screen/viewport borders. Patch by frosch.
authorrubidium
Wed, 26 Sep 2007 14:17:26 +0000
changeset 8134 c0403a1217fc
parent 8133 597f682ff48d
child 8135 17442ad0c5c1
(svn r11169) -Fix [FS#1255]: obiwan in Blitter::Drawline(), which caused it to clip too much at screen/viewport borders. Patch by frosch.
src/blitter/32bpp_base.cpp
src/blitter/8bpp_base.cpp
--- a/src/blitter/32bpp_base.cpp	Wed Sep 26 14:14:51 2007 +0000
+++ b/src/blitter/32bpp_base.cpp	Wed Sep 26 14:17:26 2007 +0000
@@ -56,7 +56,7 @@
 		stepx = 1;
 	}
 
-	if (x > 0 && y > 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
+	if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
 	if (dx > dy) {
 		frac = dy - (dx / 2);
 		while (x != x2) {
@@ -66,7 +66,7 @@
 			}
 			x += stepx;
 			frac += dy;
-			if (x > 0 && y > 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
+			if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
 		}
 	} else {
 		frac = dx - (dy / 2);
@@ -77,7 +77,7 @@
 			}
 			y += stepy;
 			frac += dx;
-			if (x > 0 && y > 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
+			if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
 		}
 	}
 }
--- a/src/blitter/8bpp_base.cpp	Wed Sep 26 14:14:51 2007 +0000
+++ b/src/blitter/8bpp_base.cpp	Wed Sep 26 14:17:26 2007 +0000
@@ -60,7 +60,7 @@
 		stepx = 1;
 	}
 
-	if (x > 0 && y > 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
+	if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
 	if (dx > dy) {
 		frac = dy - (dx / 2);
 		while (x != x2) {
@@ -70,7 +70,7 @@
 			}
 			x += stepx;
 			frac += dy;
-			if (x > 0 && y > 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
+			if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
 		}
 	} else {
 		frac = dx - (dy / 2);
@@ -81,7 +81,7 @@
 			}
 			y += stepy;
 			frac += dx;
-			if (x > 0 && y > 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
+			if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
 		}
 	}
 }