1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-09-04 07:09:30 +00:00

Fix: Off-by-one when drawing diagonal lines (#14523)

This commit is contained in:
Jonathan G Rennison
2025-08-24 13:24:17 +01:00
committed by GitHub
parent 98090fe948
commit 98ffd3cdb1

View File

@@ -82,7 +82,7 @@ void Blitter::DrawLineGeneric(int x1, int y1, int x2, int y2, int screen_width,
frac_low += dx;
y_low -= stepy;
}
while (frac_high >= 0) {
while (frac_high >= dy) {
frac_high -= dx;
y_high += stepy;
}
@@ -145,7 +145,7 @@ void Blitter::DrawLineGeneric(int x1, int y1, int x2, int y2, int screen_width,
frac_low += dy;
x_low -= stepx;
}
while (frac_high >= 0) {
while (frac_high >= dx) {
frac_high -= dy;
x_high += stepx;
}