mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-16 20:15:38 +00:00
Fixed an issue where SVG images would sometimes not get rasterized.
This commit is contained in:
parent
14ac905e09
commit
c9848d694b
|
@ -64,12 +64,14 @@ void ImageComponent::setImage(const std::string& path, bool tile)
|
|||
|
||||
// Create an initial blank texture if needed.
|
||||
if (path.empty() || !ResourceManager::getInstance().fileExists(path)) {
|
||||
if (mDefaultPath.empty() || !ResourceManager::getInstance().fileExists(mDefaultPath))
|
||||
if (mDefaultPath.empty() || !ResourceManager::getInstance().fileExists(mDefaultPath)) {
|
||||
mTexture.reset();
|
||||
else
|
||||
}
|
||||
else {
|
||||
mTexture = TextureResource::get(mDefaultPath, tile, mForceLoad, mDynamic,
|
||||
mLinearInterpolation, mMipmapping);
|
||||
resize(true);
|
||||
resize(true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// For raster images we just load and resize but for SVG images we first need to resize
|
||||
|
|
|
@ -282,7 +282,9 @@ float TextureData::sourceHeight()
|
|||
void TextureData::setSourceSize(float width, float height)
|
||||
{
|
||||
if (mScalable) {
|
||||
if (mSourceWidth != width || mSourceHeight != height) {
|
||||
// Ugly hack to make sure SVG images matching the temporary size 64x64 get rasterized.
|
||||
const bool tempSizeMatch {mPendingRasterization && width == 64 && height == 64};
|
||||
if (tempSizeMatch || mSourceWidth != width || mSourceHeight != height) {
|
||||
mSourceWidth = width;
|
||||
mSourceHeight = height;
|
||||
releaseVRAM();
|
||||
|
|
Loading…
Reference in a new issue