Fix #10222: Off by one drawing even-width horizontal/vertical lines
This commit is contained in:
committed by
Peter Nelson
parent
80f72d3722
commit
add40a2de2
@@ -78,11 +78,11 @@ void Blitter::DrawLineGeneric(int x1, int y1, int x2, int y2, int screen_width,
|
|||||||
int frac_low = dy - frac_diff / 2;
|
int frac_low = dy - frac_diff / 2;
|
||||||
int frac_high = dy + frac_diff / 2;
|
int frac_high = dy + frac_diff / 2;
|
||||||
|
|
||||||
while (frac_low < -(dx / 2)) {
|
while (frac_low < -dx) {
|
||||||
frac_low += dx;
|
frac_low += dx;
|
||||||
y_low -= stepy;
|
y_low -= stepy;
|
||||||
}
|
}
|
||||||
while (frac_high >= dx / 2) {
|
while (frac_high >= 0) {
|
||||||
frac_high -= dx;
|
frac_high -= dx;
|
||||||
y_high += stepy;
|
y_high += stepy;
|
||||||
}
|
}
|
||||||
@@ -141,11 +141,11 @@ void Blitter::DrawLineGeneric(int x1, int y1, int x2, int y2, int screen_width,
|
|||||||
int frac_low = dx - frac_diff / 2;
|
int frac_low = dx - frac_diff / 2;
|
||||||
int frac_high = dx + frac_diff / 2;
|
int frac_high = dx + frac_diff / 2;
|
||||||
|
|
||||||
while (frac_low < -(dy / 2)) {
|
while (frac_low < -dy) {
|
||||||
frac_low += dy;
|
frac_low += dy;
|
||||||
x_low -= stepx;
|
x_low -= stepx;
|
||||||
}
|
}
|
||||||
while (frac_high >= dy / 2) {
|
while (frac_high >= 0) {
|
||||||
frac_high -= dy;
|
frac_high -= dy;
|
||||||
x_high += stepx;
|
x_high += stepx;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user