Prechádzať zdrojové kódy

Merge pull request #75034 from capnm/Fix_tvg_Picture_size

SVG: fix tvg::Picture->size() and scale based errors.
Rémi Verschelde 2 rokov pred
rodič
commit
b63c77aceb
1 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 2 2
      modules/svg/image_loader_svg.cpp

+ 2 - 2
modules/svg/image_loader_svg.cpp

@@ -79,8 +79,8 @@ Error ImageLoaderSVG::create_image_from_utf8_buffer(Ref<Image> p_image, const Pa
 	float fw, fh;
 	picture->size(&fw, &fh);
 
-	uint32_t width = round(fw * p_scale);
-	uint32_t height = round(fh * p_scale);
+	uint32_t width = MAX(1, round(fw * p_scale));
+	uint32_t height = MAX(1, round(fh * p_scale));
 
 	const uint32_t max_dimension = 16384;
 	if (width > max_dimension || height > max_dimension) {