mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-01 12:57:51 +02:00
fix margin if image prescaled and not equal to current scaling
This commit is contained in:
parent
543ce94132
commit
d232b7b46b
@ -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 <tbb/parallel_for.h>
|
||||
#include <SDL_surface.h>
|
||||
@ -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<const ISharedImage> SDLImageShared::scaleInteger(int factor, SDL_Palette * palette) const
|
||||
|
Loading…
x
Reference in New Issue
Block a user