diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 7666eae8f7..84c31d16a0 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -2,6 +2,7 @@ ------------------------------------------------------------------------ - Fix: [#22918] Zooming with keyboard moves the view off centre. - Fix: [#22921] Wooden RollerCoaster flat to steep railings appear in front of track in front of them. +- Fix: [#22962] Fuzzy horizontal-to-vertical line transitions in charts. 0.4.15 (2024-10-06) ------------------------------------------------------------------------ diff --git a/src/openrct2/drawing/Line.cpp b/src/openrct2/drawing/Line.cpp index a3208b30da..def36a2ab5 100644 --- a/src/openrct2/drawing/Line.cpp +++ b/src/openrct2/drawing/Line.cpp @@ -139,7 +139,7 @@ void GfxDrawLineSoftware(DrawPixelInfo& dpi, const ScreenLine& line, int32_t col else y_step = -1; - for (int32_t x = x1, x_start = x1, no_pixels = 1; x < x2; ++x, ++no_pixels) + for (int32_t x = x1, x_start = x1, length = 1; x < x2; ++x, ++length) { // Vertical lines are drawn 1 pixel at a time if (steep) @@ -150,11 +150,11 @@ void GfxDrawLineSoftware(DrawPixelInfo& dpi, const ScreenLine& line, int32_t col { // Non vertical lines are drawn with as many pixels in a horizontal line as possible if (!steep) - GfxDrawLineOnBuffer(dpi, colour, { x_start, y }, no_pixels); + GfxDrawLineOnBuffer(dpi, colour, { x_start, y }, length); // Reset non vertical line vars x_start = x + 1; - no_pixels = 1; + length = 0; // NB: will be incremented in next iteration y += y_step; error += delta_x; } @@ -162,7 +162,7 @@ void GfxDrawLineSoftware(DrawPixelInfo& dpi, const ScreenLine& line, int32_t col // Catch the case of the last line if (x + 1 == x2 && !steep) { - GfxDrawLineOnBuffer(dpi, colour, { x_start, y }, no_pixels); + GfxDrawLineOnBuffer(dpi, colour, { x_start, y }, length); } } }