From cc22351ef4c1c07ed8b29cf3ea9bb84c57495a1b Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Wed, 21 Jun 2023 17:11:50 +0100 Subject: [PATCH] Fix small map screenshots See: #554 --- src/smallmap_gui.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index fb56177bc5..af488d43b2 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -1719,9 +1719,8 @@ void SmallMapWindow::ScreenshotCallbackHandler(void *buf, uint y, uint pitch, ui dpi.left = 0; dpi.top = y; - int32 pos = (((int32)MapMaxX() + 1) * TILE_PIXELS) / 4; - this->scroll_x = pos; - this->scroll_y = -pos; + this->scroll_x = (dpi.width / 2) - ((16 * ((int)MapSizeY() - (int)MapSizeX())) / this->zoom); + this->scroll_y = 0; /* make the screenshot */ this->DrawSmallMap(&dpi, false);