Use the correct scale.

This commit is contained in:
K. S. Ernest (iFire) Lee 2021-11-10 08:09:52 -08:00
parent bccac9ef00
commit 845a445fb4

View file

@ -75,10 +75,9 @@ void ImageLoaderSVG::create_image_from_string(Ref<Image> p_image, String p_strin
return;
}
picture->viewbox(nullptr, nullptr, &fw, &fh);
const float upscale = p_upsample ? 2.0 : 1.0;
uint32_t width = MIN(fw * p_scale * upscale, 16 * 1024);
uint32_t height = MIN(fh * p_scale * upscale, 16 * 1024);
uint32_t width = MIN(fw * p_scale, 16 * 1024);
uint32_t height = MIN(fh * p_scale, 16 * 1024);
picture->size(width, height);
std::unique_ptr<tvg::SwCanvas> sw_canvas = tvg::SwCanvas::gen();