diff --git a/client/renderSDL/SDLImage.cpp b/client/renderSDL/SDLImage.cpp index df10c01d8..1f5932094 100644 --- a/client/renderSDL/SDLImage.cpp +++ b/client/renderSDL/SDLImage.cpp @@ -19,6 +19,8 @@ #include "../render/CDefFile.h" #include "../render/Graphics.h" #include "../xBRZ/xbrz.h" +#include "../gui/CGuiHandler.h" +#include "../render/IScreenHandler.h" #include #include @@ -276,6 +278,12 @@ void SDLImageShared::optimizeSurface() margins.x += left; margins.y += top; } + + if(preScaleFactor > 1 && preScaleFactor != GH.screenHandler().getScalingFactor()) + { + margins.x = margins.x * GH.screenHandler().getScalingFactor() / preScaleFactor; + margins.y = margins.y * GH.screenHandler().getScalingFactor() / preScaleFactor; + } } std::shared_ptr SDLImageShared::scaleInteger(int factor, SDL_Palette * palette, EImageBlitMode mode) const