From 28b156d95cf246529adc387816073b085ea8cd3d Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sat, 3 Feb 2024 14:57:15 +0000 Subject: [PATCH] Fix rounding of right edge of viewport mark dirty area Could result in vehicles leaving pixels behind when moving left --- src/viewport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/viewport.cpp b/src/viewport.cpp index 82e6a4a205..84f78bf8d7 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -4392,7 +4392,7 @@ void MarkViewportDirty(Viewport * const vp, int left, int top, int right, int bo uint x = std::max(0, UnScaleByZoomLower(left, vp->zoom) - vp->dirty_block_left_margin) >> vp->GetDirtyBlockWidthShift(); uint y = UnScaleByZoomLower(top, vp->zoom) >> vp->GetDirtyBlockHeightShift(); - uint w = (std::max(0, UnScaleByZoomLower(right, vp->zoom) - 1 - vp->dirty_block_left_margin) >> vp->GetDirtyBlockWidthShift()) + 1 - x; + uint w = (std::max(0, UnScaleByZoom(right, vp->zoom) - 1 - vp->dirty_block_left_margin) >> vp->GetDirtyBlockWidthShift()) + 1 - x; uint h = ((UnScaleByZoom(bottom, vp->zoom) - 1) >> vp->GetDirtyBlockHeightShift()) + 1 - y; uint column_skip = vp->dirty_blocks_per_column - h;