From 848e0a1a94e828e5f25da9152c5dc9741fc7a470 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 26 Oct 2021 18:13:31 +0200 Subject: [PATCH] Fixed an SVG graphics corruption issue. --- es-core/src/resources/TextureData.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/es-core/src/resources/TextureData.cpp b/es-core/src/resources/TextureData.cpp index 927a03854..e8476fbd8 100644 --- a/es-core/src/resources/TextureData.cpp +++ b/es-core/src/resources/TextureData.cpp @@ -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(std::round(mSourceWidth * mScaleDuringLoad));