diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2025-03-14 23:26:46 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2025-03-17 13:47:58 +0100 |
commit | d5f49e4bef99e2ae4b39bdf1b7c644c28a85c5a2 (patch) | |
tree | 4b636ee814f7f96f1a594e091c9b52ee820fe169 /src | |
parent | ea172d1a0ebcd39069e6a24f6f36d0c542c7cdf4 (diff) | |
download | mana-d5f49e4bef99e2ae4b39bdf1b7c644c28a85c5a2.tar.gz mana-d5f49e4bef99e2ae4b39bdf1b7c644c28a85c5a2.tar.bz2 mana-d5f49e4bef99e2ae4b39bdf1b7c644c28a85c5a2.tar.xz mana-d5f49e4bef99e2ae4b39bdf1b7c644c28a85c5a2.zip |
Fixed small issue in SDLGraphics::drawRescaledImagePattern
It wasn't setting the size of the srcRect correctly when the last drawn
images were partially cut off and the image wasn't being rendered at 1:1
scale.
This issue might have affected ambient layers with mKeepRatio set to
true.
Diffstat (limited to 'src')
-rw-r--r-- | src/sdlgraphics.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sdlgraphics.cpp b/src/sdlgraphics.cpp index 44e89222..28907b1e 100644 --- a/src/sdlgraphics.cpp +++ b/src/sdlgraphics.cpp @@ -198,7 +198,8 @@ void SDLGraphics::drawRescaledImagePattern(const Image *image, SDL_Rect dstRect; dstRect.x = dstX; dstRect.y = dstY; dstRect.w = dw; dstRect.h = dh; - srcRect.w = dw; srcRect.h = dh; + srcRect.w = image->mBounds.w * dw / scaledWidth; + srcRect.h = image->mBounds.h * dh / scaledHeight; if (SDL_RenderCopy(mRenderer, image->mTexture, &srcRect, &dstRect)) return; |