Fixed an SVG graphics corruption issue.

This commit is contained in:
Leon Styhre 2021-10-26 18:13:31 +02:00
parent c0f37cd088
commit 848e0a1a94

View file

@ -75,9 +75,9 @@ bool TextureData::initSVGFromMemory(const std::string& fileData)
if (mSourceWidth == 0.0f && mSourceHeight == 0.0f) {
if (!mAlwaysRasterize)
rasterize = false;
mSourceWidth = svgImage->width;
mSourceHeight = svgImage->height;
// Set a small temporary size that maintains the image aspect ratio.
mSourceWidth = 64.0f;
mSourceHeight = 64.0f * (svgImage->height / svgImage->width);
}
mWidth = static_cast<int>(std::round(mSourceWidth * mScaleDuringLoad));