mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-22 03:39:45 +02:00
Fix positioning of scaleable main menu when xbrz is in use
This commit is contained in:
parent
23f3936739
commit
03b7622a1d
@ -111,12 +111,12 @@ public:
|
|||||||
virtual bool isTransparent(const Point & coords) const = 0;
|
virtual bool isTransparent(const Point & coords) const = 0;
|
||||||
virtual void draw(SDL_Surface * where, SDL_Palette * palette, const Point & dest, const Rect * src, const ColorRGBA & colorMultiplier, uint8_t alpha, EImageBlitMode mode) const = 0;
|
virtual void draw(SDL_Surface * where, SDL_Palette * palette, const Point & dest, const Rect * src, const ColorRGBA & colorMultiplier, uint8_t alpha, EImageBlitMode mode) const = 0;
|
||||||
|
|
||||||
virtual std::shared_ptr<IImage> createImageReference(EImageBlitMode mode) const = 0;
|
[[nodiscard]] virtual std::shared_ptr<IImage> createImageReference(EImageBlitMode mode) const = 0;
|
||||||
|
|
||||||
virtual std::shared_ptr<const ISharedImage> horizontalFlip() const = 0;
|
[[nodiscard]] virtual std::shared_ptr<const ISharedImage> horizontalFlip() const = 0;
|
||||||
virtual std::shared_ptr<const ISharedImage> verticalFlip() const = 0;
|
[[nodiscard]] virtual std::shared_ptr<const ISharedImage> verticalFlip() const = 0;
|
||||||
virtual std::shared_ptr<const ISharedImage> scaleInteger(int factor, SDL_Palette * palette, EImageBlitMode blitMode) const = 0;
|
[[nodiscard]] virtual std::shared_ptr<const ISharedImage> scaleInteger(int factor, SDL_Palette * palette, EImageBlitMode blitMode) const = 0;
|
||||||
virtual std::shared_ptr<const ISharedImage> scaleTo(const Point & size, SDL_Palette * palette) const = 0;
|
[[nodiscard]] virtual std::shared_ptr<const ISharedImage> scaleTo(const Point & size, SDL_Palette * palette) const = 0;
|
||||||
|
|
||||||
|
|
||||||
virtual ~ISharedImage() = default;
|
virtual ~ISharedImage() = default;
|
||||||
|
@ -43,6 +43,9 @@ void ImageScaled::scaleInteger(int factor)
|
|||||||
|
|
||||||
void ImageScaled::scaleTo(const Point & size)
|
void ImageScaled::scaleTo(const Point & size)
|
||||||
{
|
{
|
||||||
|
if (source)
|
||||||
|
source = source->scaleTo(size, nullptr);
|
||||||
|
|
||||||
if (body)
|
if (body)
|
||||||
body = body->scaleTo(size * GH.screenHandler().getScalingFactor(), nullptr);
|
body = body->scaleTo(size * GH.screenHandler().getScalingFactor(), nullptr);
|
||||||
}
|
}
|
||||||
|
@ -57,11 +57,11 @@ public:
|
|||||||
void exportBitmap(const boost::filesystem::path & path, SDL_Palette * palette) const override;
|
void exportBitmap(const boost::filesystem::path & path, SDL_Palette * palette) const override;
|
||||||
Point dimensions() const override;
|
Point dimensions() const override;
|
||||||
bool isTransparent(const Point & coords) const override;
|
bool isTransparent(const Point & coords) const override;
|
||||||
std::shared_ptr<IImage> createImageReference(EImageBlitMode mode) const override;
|
[[nodiscard]] std::shared_ptr<IImage> createImageReference(EImageBlitMode mode) const override;
|
||||||
std::shared_ptr<const ISharedImage> horizontalFlip() const override;
|
[[nodiscard]] std::shared_ptr<const ISharedImage> horizontalFlip() const override;
|
||||||
std::shared_ptr<const ISharedImage> verticalFlip() const override;
|
[[nodiscard]] std::shared_ptr<const ISharedImage> verticalFlip() const override;
|
||||||
std::shared_ptr<const ISharedImage> scaleInteger(int factor, SDL_Palette * palette, EImageBlitMode blitMode) const override;
|
[[nodiscard]] std::shared_ptr<const ISharedImage> scaleInteger(int factor, SDL_Palette * palette, EImageBlitMode blitMode) const override;
|
||||||
std::shared_ptr<const ISharedImage> scaleTo(const Point & size, SDL_Palette * palette) const override;
|
[[nodiscard]] std::shared_ptr<const ISharedImage> scaleTo(const Point & size, SDL_Palette * palette) const override;
|
||||||
|
|
||||||
friend class SDLImageLoader;
|
friend class SDLImageLoader;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user